| 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 | |
|---|
| 11 | ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) |
|---|
| 12 | CFLAGS += -g |
|---|
| 13 | endif |
|---|
| 14 | ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
|---|
| 15 | INSTALL_PROGRAM += -s |
|---|
| 16 | endif |
|---|
| 17 | |
|---|
| 18 | # This has to be exported to make some magic below work. |
|---|
| 19 | export DH_OPTIONS |
|---|
| 20 | |
|---|
| 21 | build: build-stamp |
|---|
| 22 | build-stamp: |
|---|
| 23 | dh_testdir |
|---|
| 24 | |
|---|
| 25 | # compilation et installation des binaires |
|---|
| 26 | pushd src/ && $(MAKE) && popd |
|---|
| 27 | |
|---|
| 28 | touch build-stamp |
|---|
| 29 | |
|---|
| 30 | clean: |
|---|
| 31 | dh_testdir |
|---|
| 32 | dh_testroot |
|---|
| 33 | rm -f build-stamp |
|---|
| 34 | |
|---|
| 35 | -pushd src/ && $(MAKE) clean && popd |
|---|
| 36 | |
|---|
| 37 | dh_clean |
|---|
| 38 | |
|---|
| 39 | install: DH_OPTIONS= |
|---|
| 40 | install: build |
|---|
| 41 | dh_testdir |
|---|
| 42 | dh_testroot |
|---|
| 43 | dh_clean -k |
|---|
| 44 | dh_installdirs |
|---|
| 45 | |
|---|
| 46 | # default perms that should be used |
|---|
| 47 | # usr/lib/alternc/* root.www-data 750 |
|---|
| 48 | # etc/alternc/* root.root 750 |
|---|
| 49 | |
|---|
| 50 | # Add here commands to install the package into debian/tmp. |
|---|
| 51 | # conffiles |
|---|
| 52 | install -o root -g www-data -m0750 -d debian/alternc/etc/alternc |
|---|
| 53 | install -o root -g www-data -m0750 \ |
|---|
| 54 | install/etc/alternc/alternc.conf debian/alternc/etc/alternc/ |
|---|
| 55 | # les scripts d'install |
|---|
| 56 | # TODO laisser les scripts dans /usr/share et faire des liens |
|---|
| 57 | # symboliques (ou pas) |
|---|
| 58 | cp install/scripts/alternc.install debian/alternc/usr/sbin |
|---|
| 59 | cp -r install/scripts/* debian/alternc/usr/share/alternc/install |
|---|
| 60 | cp -r bureau debian/alternc/var/alternc/ |
|---|
| 61 | # installation des binaires |
|---|
| 62 | pushd src/ && $(MAKE) install DESTDIR=$(CURDIR)/debian/alternc && popd |
|---|
| 63 | |
|---|
| 64 | cp -r dns/bind2 debian/alternc/usr/lib/alternc/system/ |
|---|
| 65 | |
|---|
| 66 | # On efface les dossiers CVS |
|---|
| 67 | /usr/bin/find debian/alternc -depth -type d -name CVS -exec rm {} -rf \; |
|---|
| 68 | |
|---|
| 69 | pushd debian/alternc/usr/share/alternc/install ; \ |
|---|
| 70 | chmod a+x alternc.install initrep.sh mysql.sh newone.php ; \ |
|---|
| 71 | popd |
|---|
| 72 | |
|---|
| 73 | install -m 0644 debian/lintian-override debian/alternc/usr/share/lintian/overrides/alternc |
|---|
| 74 | |
|---|
| 75 | # dh_install --prefix=install/alternc |
|---|
| 76 | |
|---|
| 77 | # This single target is used to build all the packages, all at once, or |
|---|
| 78 | # one at a time. So keep in mind: any options passed to commands here will |
|---|
| 79 | # affect _all_ packages. Anything you want to only affect one package |
|---|
| 80 | # should be put in another target, such as the install target. |
|---|
| 81 | |
|---|
| 82 | binary-common: build install |
|---|
| 83 | dh_testdir |
|---|
| 84 | dh_testroot |
|---|
| 85 | dh_installchangelogs |
|---|
| 86 | dh_installdocs |
|---|
| 87 | # dh_installexamples |
|---|
| 88 | # dh_installmenu |
|---|
| 89 | dh_installdebconf |
|---|
| 90 | dh_installlogrotate |
|---|
| 91 | # dh_installemacsen |
|---|
| 92 | # dh_installpam |
|---|
| 93 | # dh_installmime |
|---|
| 94 | # dh_installinit |
|---|
| 95 | # dh_installman |
|---|
| 96 | dh_installcron |
|---|
| 97 | # dh_installinfo |
|---|
| 98 | # dh_undocumented |
|---|
| 99 | # dh_installman |
|---|
| 100 | dh_strip |
|---|
| 101 | dh_link |
|---|
| 102 | dh_compress |
|---|
| 103 | #we handle our own perms |
|---|
| 104 | # dh_fixperms |
|---|
| 105 | |
|---|
| 106 | |
|---|
| 107 | # dh_makeshlibs |
|---|
| 108 | dh_installdeb |
|---|
| 109 | dh_perl |
|---|
| 110 | # dh_shlibdeps |
|---|
| 111 | dh_gencontrol -- -cdebian/control |
|---|
| 112 | dh_md5sums |
|---|
| 113 | dh_builddeb |
|---|
| 114 | |
|---|
| 115 | # Build architecture independant packages using the common target. |
|---|
| 116 | binary-indep: build install binary-common |
|---|
| 117 | # (Uncomment this next line if you have such packages.) |
|---|
| 118 | # $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common |
|---|
| 119 | |
|---|
| 120 | # Build architecture dependant packages using the common target. |
|---|
| 121 | binary-arch: build install binary-common |
|---|
| 122 | # $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common |
|---|
| 123 | |
|---|
| 124 | # Any other binary targets build just one binary package at a time. |
|---|
| 125 | # binary-%: build install |
|---|
| 126 | # make -f debian/rules binary-common DH_OPTIONS=-p$* |
|---|
| 127 | |
|---|
| 128 | # binary: binary-indep binary-arch |
|---|
| 129 | # .PHONY: build clean binary-indep binary-arch binary install |
|---|
| 130 | |
|---|
| 131 | binary: binary-common |
|---|
| 132 | |
|---|
| 133 | .PHONY: build clean binary install |
|---|