root/alternc/trunk/debian/rules

Revision 2435, 5.2 kB (checked in by anarcat, 2 months ago)

try to fix snapshot

  • Property svn:executable set to *
Line 
1 #!/usr/bin/make -f
2 # Sample debian/rules that uses debhelper.
3 # This file is public domain software, originally written by Joey Hess.
4 #
5 # This version is for a multibinary package. It also allows you to build any
6 # of the binary packages independantly, via binary-<package> targets.
7
8 # Uncomment this to turn on verbose mode.
9 export DH_VERBOSE=1
10 MAJOR=$(shell sed -ne 's/^[^(]*(\([^)]*\)).*/\1/;1p' debian/changelog)
11 REV=$(shell svn up > /dev/null ; env LANG=C svn info --non-interactive | awk '/^Revision:/ { print $$2 }')
12 VERSION="${MAJOR}~svn${REV}"
13 export VERSION
14
15 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
16         CFLAGS += -g
17 endif
18 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
19         INSTALL_PROGRAM += -s
20 endif
21
22 # This has to be exported to make some magic below work.
23 export DH_OPTIONS
24
25 build: build-stamp
26 build-stamp:
27         dh_testdir
28         /usr/bin/msgfmt po/fr/LC_MESSAGES/alternc-admintools.po -o po/fr/LC_MESSAGES/alternc-admintools.mo
29         touch build-stamp
30
31 clean:
32         dh_testdir
33         dh_testroot
34         rm -f build-stamp
35         debconf-updatepo
36         dh_clean
37
38 install: DH_OPTIONS=
39 install: build
40         dh_testdir
41         dh_testroot
42         dh_clean -k
43         dh_installdirs
44
45         # Install
46         cp -r etc/* debian/alternc/etc
47         cp -r install/* debian/alternc/usr/share/alternc/install
48         cp -r bureau/* debian/alternc/var/alternc/bureau
49         (cd src && $(MAKE) install DESTDIR=$(CURDIR)/debian/alternc)
50
51         # we don't use the full VERSION intepreted but only what's in the changelog
52         sed -i -e "s/@@REPLACED_DURING_BUILD@@/${MAJOR}/" debian/alternc/var/alternc/bureau/class/local.php
53
54         # Fix permisions
55         chmod 755 debian/alternc/etc/alternc
56         chmod 644 debian/alternc/etc/alternc/phpmyadmin.inc.php
57         chown -R root:www-data debian/alternc/var/alternc/bureau
58         chmod 1733 debian/alternc/var/alternc/sessions
59         chmod -R 644 debian/alternc/var/alternc/bureau
60         chmod -R a+X debian/alternc/var/alternc/bureau
61         chown -R www-data:www-data debian/alternc/var/alternc/dns debian/alternc/var/alternc/html debian/alternc/var/run/alternc debian/alternc/var/log/alternc debian/alternc/var/alternc/tmp
62         chmod a+x debian/alternc/usr/share/alternc/install/alternc.install debian/alternc/usr/share/alternc/install/dopo.sh debian/alternc/usr/share/alternc/install/mysql.sh debian/alternc/usr/share/alternc/install/newone.php debian/alternc/usr/share/alternc/install/reset_root.php debian/alternc/usr/share/alternc/install/upgrade_check.sh debian/alternc/usr/share/alternc/install/upgrades/*.php debian/alternc/usr/share/alternc/install/upgrades/*.sh
63
64         for sub in dns dns/redir mail html apacheconf; do \
65                 for i in a b c d e f g h i j k l m n o p q r s t u v w x y z _ 0 1 2 3 4 5 6 7 8 9; do \
66                         mkdir -p debian/alternc/var/alternc/${sub}/${i} ;\
67                         chown www-data debian/alternc/var/alternc/${sub}/${i} ;\
68                 done ;\
69         done
70
71         # Ex old alternc-admintools
72         install tools/top_http_users debian/alternc/usr/bin
73         install tools/top_mysql_users debian/alternc/usr/bin
74         install tools/top_ftp_users debian/alternc/usr/bin
75         install tools/get_domains_by_account debian/alternc/usr/bin
76         install tools/get_account_by_domain debian/alternc/usr/bin
77         install -m 644 po/fr/LC_MESSAGES/alternc-admintools.mo debian/alternc/usr/share/locale/fr/LC_MESSAGES/
78
79         # Remove helpers files from l18n dir
80         find debian/alternc/var/alternc/bureau/locales/ \
81                 -maxdepth 1 -type f -exec rm -f {} \;
82         # Remove CVS directories
83         /usr/bin/find debian/alternc -depth -type d -name CVS -exec rm {} -rf \;
84         /usr/bin/find debian/alternc -depth -type d -name .svn -exec rm {} -rf \;
85         cp debian/alternc.lintian debian/alternc/usr/share/lintian/overrides/alternc
86         cp debian/alternc-slave.lintian debian/alternc/usr/share/lintian/overrides/alternc-slave
87
88 # This single target is used to build all the packages, all at once, or
89 # one at a time. So keep in mind: any options passed to commands here will
90 # affect _all_ packages. Anything you want to only affect one package
91 # should be put in another target, such as the install target.
92
93 binary-common: build install
94         dh_testdir
95         dh_testroot
96         dh_installchangelogs
97         dh_installdocs
98 #       dh_installexamples
99 #       dh_installmenu
100         dh_installdebconf
101         dh_installlogrotate
102 #       dh_installemacsen
103 #       dh_installpam
104 #       dh_installmime
105 #       dh_installinit
106         dh_installman man/*
107         dh_installcron
108 #       dh_installinfo
109         dh_install -i --sourcedir=$(CURDIR)/debian/alternc
110         dh_strip
111         dh_link
112         dh_compress
113 #we handle our own perms
114 #       dh_fixperms
115 #       dh_makeshlibs
116         dh_installdeb
117         dh_perl
118         dh_shlibdeps
119         dh_gencontrol -- -cdebian/control
120         dh_md5sums
121         dh_builddeb
122
123 # Build architecture independant packages using the common target.
124 binary-indep: build install binary-common
125 # (Uncomment this next line if you have such packages.)
126 #        $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
127
128 # Build architecture dependant packages using the common target.
129 binary-arch: build install binary-common
130 #       $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
131
132 # Any other binary targets build just one binary package at a time.
133 # binary-%: build install
134 #       make -f debian/rules binary-common DH_OPTIONS=-p$*
135
136 # binary: binary-indep binary-arch
137 # .PHONY: build clean binary-indep binary-arch binary install
138
139 binary: binary-common
140
141 .PHONY: build clean binary install
142
143 build-snapshot:
144         @echo "building a package based on the current snapshot (${VERSION})"
145         svn update || true
146         svn export . ../alternc-${VERSION}
147         cd ../alternc-${VERSION} && sed -i -e '1s/)/~svn${REV})/' debian/changelog && debuild
Note: See TracBrowser for help on using the browser.