source: alternc/trunk/debian/rules @ 2286

Revision 2286, 5.2 KB checked in by anarcat, 5 years ago (diff)

fix lintian. again.

  • 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.
9export DH_VERBOSE=1
10MAJOR=$(shell sed -ne 's/^[^(]*(\([^)]*\)).*/\1/;1p' debian/changelog)
11REV=$(shell LANG=C svn info --non-interactive | awk '/^Revision:/ { print $$2 }')
12VERSION="${MAJOR}~svn${REV}"
13export VERSION
14
15ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
16        CFLAGS += -g
17endif
18ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
19        INSTALL_PROGRAM += -s
20endif
21
22# This has to be exported to make some magic below work.
23export DH_OPTIONS
24
25build: build-stamp
26build-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
31clean:
32        dh_testdir
33        dh_testroot
34        rm -f build-stamp
35        debconf-updatepo
36        dh_clean
37
38install: DH_OPTIONS=
39install: 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 -R 644 debian/alternc/var/alternc/bureau
59        chmod -R a+X debian/alternc/var/alternc/bureau
60        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
61        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
62
63        for sub in dns dns/redir mail html apacheconf; do \
64                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 \
65                        mkdir -p debian/alternc/var/alternc/${sub}/${i} ;\
66                        chown www-data debian/alternc/var/alternc/${sub}/${i} ;\
67                done ;\
68        done
69
70        # Ex old alternc-admintools
71        install tools/top_http_users debian/alternc/usr/bin
72        install tools/top_mysql_users debian/alternc/usr/bin
73        install tools/top_ftp_users debian/alternc/usr/bin
74        install tools/get_domains_by_account debian/alternc/usr/bin
75        install tools/get_account_by_domain debian/alternc/usr/bin
76        install -m 644 po/fr/LC_MESSAGES/alternc-admintools.mo debian/alternc/usr/share/locale/fr/LC_MESSAGES/
77
78        # Remove helpers files from l18n dir
79        find debian/alternc/var/alternc/bureau/locales/ \
80                -maxdepth 1 -type f -exec rm -f {} \;
81        # Remove CVS directories
82        /usr/bin/find debian/alternc -depth -type d -name CVS -exec rm {} -rf \;
83        /usr/bin/find debian/alternc -depth -type d -name .svn -exec rm {} -rf \;
84        cp debian/lintian-override debian/alternc/usr/share/lintian/overrides/alternc
85        cp debian/lintian-override debian/alternc/usr/share/lintian/overrides/alternc-slavedns
86
87# This single target is used to build all the packages, all at once, or
88# one at a time. So keep in mind: any options passed to commands here will
89# affect _all_ packages. Anything you want to only affect one package
90# should be put in another target, such as the install target.
91
92binary-common: build install
93        dh_testdir
94        dh_testroot
95        dh_installchangelogs
96        dh_installdocs
97#       dh_installexamples
98#       dh_installmenu
99        dh_installdebconf
100        dh_installlogrotate
101#       dh_installemacsen
102#       dh_installpam
103#       dh_installmime
104#       dh_installinit
105        dh_installman man/*
106        dh_installcron
107#       dh_installinfo
108        dh_install -i --sourcedir=$(CURDIR)/debian/alternc
109        dh_strip
110        dh_link
111        dh_compress
112#we handle our own perms
113#       dh_fixperms
114#       dh_makeshlibs
115        dh_installdeb
116        dh_perl
117        dh_shlibdeps
118        dh_gencontrol -- -cdebian/control
119        dh_md5sums
120        dh_builddeb
121
122# Build architecture independant packages using the common target.
123binary-indep: build install binary-common
124# (Uncomment this next line if you have such packages.)
125#        $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
126
127# Build architecture dependant packages using the common target.
128binary-arch: build install binary-common
129#       $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
130
131# Any other binary targets build just one binary package at a time.
132# binary-%: build install
133#       make -f debian/rules binary-common DH_OPTIONS=-p$*
134
135# binary: binary-indep binary-arch
136# .PHONY: build clean binary-indep binary-arch binary install
137
138binary: binary-common
139
140.PHONY: build clean binary install
141
142build-snapshot:
143        @echo "building a package based on the current snapshot (${VERSION})"
144        svn update || true
145        svn export . ../alternc-${VERSION}
146        cd ../alternc-${VERSION} && sed -i -e '0,/UNRELEASED/s/)/~svn${REV})/' debian/changelog && debuild
Note: See TracBrowser for help on using the repository browser.