Changeset 095a5f0 for debian/rules


Ignore:
Timestamp:
2010-06-05T14:47:54Z (9 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
4c03881
Parents:
04dc563
Message:

Redid debian/rules using debhelper, with good results. This creates mostly
fine debs. Need to do some more checks, and make sure bitlbee-libpurple
gets the same maintainer scripts as bitlbee.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • debian/rules

    r04dc563 r095a5f0  
    11#!/usr/bin/make -f
     2#
     3# Finally switching to debhelper.
     4#
     5# Not using debhelper was an exercise suggested to me by my AM (Gergely
     6# Nagy). It was educating at the time but I finally decided that the
     7# exercise is over now.
     8#
    29
    310BITLBEE_CONFIGURE_FLAGS ?=
     
    815else
    916# Want to use the full package version number instead of just the release.
    10 BITLBEE_VERSION ?= "$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}')"
    11 export BITLBEE_VERSION
     17BITLBEE_CONFIGURE_VERSION ?= BITLBEE_VERSION=\"$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}')\"
    1218endif
    1319
    14 build-arch: build-arch-stamp
    15 build-arch-stamp:
    16         [ -d debian ]
    17         ./configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent $(BITLBEE_CONFIGURE_FLAGS)
    18         $(MAKE)
    19 #       $(MAKE) -C doc/ all
    20         touch build-arch-stamp
     20build: build-stamp
     21build-stamp:
     22        dh_testdir
     23
     24        mkdir debian/build-native
     25        ROOT=$$PWD; cd debian/build-native; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent $(BITLBEE_CONFIGURE_FLAGS)
     26        $(MAKE) -C debian/build-native
     27
     28        mkdir debian/build-libpurple
     29        ROOT=$$PWD; cd debian/build-libpurple; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --purple=1 $(BITLBEE_CONFIGURE_FLAGS)
     30        $(MAKE) -C debian/build-libpurple
     31
     32        touch build-stamp
    2133
    2234clean:
    23         [ "`whoami`" = "root" -a -d debian ]
    24         rm -rf build-arch-stamp debian/bitlbee debian/*.substvars debian/files debian/bitlbee-dev
     35        dh_testdir
     36        dh_testroot
     37        rm -f build-stamp
     38
     39        rm -rf build-arch-stamp debian/build-*
    2540        $(MAKE) distclean
    26 #       -$(MAKE) -C doc/ clean
    27                                
    2841
    29 install-arch: build-arch
    30         [ "`whoami`" = "root" -a -d debian ]
    31         mkdir -p debian/bitlbee/DEBIAN/
    32         $(MAKE) install install-etc DESTDIR=`pwd`/debian/bitlbee
     42        dh_clean
    3343
    34         mkdir -p debian/bitlbee/usr/share/doc/bitlbee/
    35         cp doc/user-guide/user-guide.txt debian/bitlbee/usr/share/doc/bitlbee/
    36         cp doc/user-guide/user-guide.html debian/bitlbee/usr/share/doc/bitlbee/
     44install: build
     45        dh_testdir
     46        dh_testroot
     47        dh_prep
     48        dh_installdirs
    3749
    38 install-indep: install-arch
    39         [ "`whoami`" = "root" -a -d debian ]
    40         mkdir -p debian/bitlbee-dev/DEBIAN/
    41         $(MAKE) install-dev DESTDIR=`pwd`/debian/bitlbee-dev
     50        $(MAKE) -C debian/build-native install install-etc DESTDIR=`pwd`/debian/bitlbee
     51        $(MAKE) -C debian/build-libpurple install install-etc DESTDIR=`pwd`/debian/bitlbee-libpurple
     52        $(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev
    4253
    43         mkdir -p debian/bitlbee-dev/usr/share/doc/bitlbee-dev/
     54        patch debian/bitlbee/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff
     55        patch debian/bitlbee-libpurple/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff
    4456
    45 binary-arch: build-arch install-arch
    46         [ "`whoami`" = "root" -a -d debian ]
     57        mkdir -p debian/bitlbee-common/usr
     58        mv debian/bitlbee/usr/share debian/bitlbee-common/usr
     59        rm -rf debian/bitlbee-libpurple/usr/share
    4760
    48         chmod 755 debian/post* debian/pre* debian/config debian/bitlbee.init
     61binary-common:
     62        dh_testdir
     63        dh_testroot
    4964
    50         mkdir -p debian/bitlbee/usr/share/doc/bitlbee/examples/ debian/bitlbee/etc/init.d/
    51         -cp doc/RELEASE-SPEECH* debian/bitlbee/usr/share/doc/bitlbee/ && gzip -9 debian/bitlbee/usr/share/doc/bitlbee/RELEASE-SPEECH*
    52         cp doc/CREDITS doc/AUTHORS doc/README doc/FAQ debian/README.Debian debian/bitlbee/usr/share/doc/bitlbee/
    53         cp debian/changelog debian/bitlbee/usr/share/doc/bitlbee/changelog.Debian
    54         cp debian/copyright debian/bitlbee/usr/share/doc/bitlbee/copyright
    55         cp doc/CHANGES debian/bitlbee/usr/share/doc/bitlbee/changelog
    56         cp utils/* debian/bitlbee/usr/share/doc/bitlbee/examples/
    57         cp debian/bitlbee.init debian/bitlbee/etc/init.d/bitlbee
    58         patch -p0 < debian/patches/bitlbee.conf.diff
    59         cd debian/bitlbee/usr/share/; \
    60                 gzip -9 doc/bitlbee/changelog.Debian doc/bitlbee/changelog doc/bitlbee/user-guide.txt \
    61                         doc/bitlbee/examples/* man/man8/bitlbee.8 man/man5/bitlbee.conf.5
    62        
    63         chown -R root:root debian/bitlbee/
    64         find debian/bitlbee/usr/share/ -type d -exec chmod 755 {} \;
    65         find debian/bitlbee/usr/share/ -type f -exec chmod 644 {} \;
    66        
    67         cp debian/prerm debian/bitlbee/DEBIAN/
    68         cp debian/postinst debian/bitlbee/DEBIAN/
    69         cp debian/postrm debian/bitlbee/DEBIAN/
    70         cp debian/config debian/bitlbee/DEBIAN/
     65        dh_installdocs --link-doc=bitlbee-common
     66        dh_installchangelogs
     67        dh_installexamples
     68        dh_installdebconf
     69        dh_installinit
     70        dh_installman
     71        dh_strip
     72        dh_link
     73        dh_compress
     74        dh_fixperms
     75        dh_installdeb
     76        dh_shlibdeps
     77ifdef BITLBEE_FORCE_VERSION
     78        dh_gencontrol -- -v1:$(BITLBEE_VERSION)-0
     79else
     80        dh_gencontrol
     81endif
     82        dh_md5sums
     83        dh_builddeb
    7184
    72         po2debconf debian/templates > debian/bitlbee/DEBIAN/templates
    73         cp debian/conffiles debian/bitlbee/DEBIAN/
    74        
    75         if [ "$(DEBUG)" = "0" ]; then strip -R .comment -R .note debian/bitlbee/usr/sbin/bitlbee; fi
     85binary-indep: build install
     86        $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
    7687
    77         cd debian/bitlbee; \
    78                 find usr -type f -exec md5sum {} \; > DEBIAN/md5sums
    79         dpkg-shlibdeps -Tdebian/bitlbee.substvars -dDepends debian/bitlbee/usr/sbin/bitlbee
    80 ifdef BITLBEE_FORCE_VERSION
    81         dpkg-gencontrol -ldebian/changelog -isp -pbitlbee -Tdebian/bitlbee.substvars -Pdebian/bitlbee -v1:$(BITLBEE_VERSION)-0 -V'debconf-depends=debconf (>= 1.2.0) | debconf-2.0'
    82 else
    83         dpkg-gencontrol -ldebian/changelog -isp -pbitlbee -Tdebian/bitlbee.substvars -Pdebian/bitlbee -V'debconf-depends=debconf (>= 1.2.0) | debconf-2.0'
    84 endif
     88binary-arch: build install
     89        $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
    8590
    86         dpkg --build debian/bitlbee ..
     91binary-%: build install
     92        make -f debian/rules binary-common DH_OPTIONS=-p$*
    8793
    88 binary-indep: install-indep
    89         [ "`whoami`" = "root" -a -d debian ]
    90 
    91         chown -R root.root debian/bitlbee-dev/
    92         find debian/bitlbee-dev/usr/share/ -type d -exec chmod 755 {} \;
    93         find debian/bitlbee-dev/usr/share/ -type f -exec chmod 644 {} \;
    94 
    95         cp debian/changelog debian/bitlbee-dev/usr/share/doc/bitlbee-dev/changelog.Debian
    96         gzip -9 debian/bitlbee-dev/usr/share/doc/bitlbee-dev/changelog.Debian
    97         cp debian/copyright debian/bitlbee-dev/usr/share/doc/bitlbee-dev/copyright
    98 
    99         cd debian/bitlbee-dev; \
    100                 find usr -type f -exec md5sum {} \; > DEBIAN/md5sums
    101 
    102         dpkg-gencontrol -ldebian/changelog -isp -pbitlbee-dev -Pdebian/bitlbee-dev -v1:$(BITLBEE_VERSION)-0
    103 
    104         dpkg --build debian/bitlbee-dev ..
    105 
    106 binary: binary-arch binary-indep
    107 build: build-arch
    108 install: install-arch install-indep
    109 
    110 .PHONY: build-arch build clean binary-arch binary install-arch install binary-indep install-indep
     94binary: binary-indep binary-arch
     95.PHONY: build clean binary-indep binary-arch binary-common binary install
Note: See TracChangeset for help on using the changeset viewer.