~ubuntu-branches/ubuntu/trusty/developers-reference/trusty

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Adam Di Carlo
  • Date: 2002-04-07 23:34:08 UTC
  • Revision ID: james.westby@ubuntu.com-20020407233408-5kocoy6rn49z4soo
Tags: 2.11
* Antoine Hulin:
  - some grammar corrections
  - update French translation
* Martin Michlmayr:
  - changes in upload situation, not possible to remove from Incoming
    anymore; closes: #135559
  - also talk about dput a tiny bit
* Adam Di Carlo:
  - Ch "Overview of Debian Maintainer Tools":
    - improve the intro
    - Charles Briscoe-Smith deprecates yada (I think new maintainers of
      that would be welcome)
    - debconf-doc mentioned for debconf
    - debhelper: don't talk about debmake; mention how to get info on the dh-* pkgs
    - dput: new section, closes: #129378
    - debootstrap: new section, closes: #129377
    - dpkg-dev-el: new section
    - other minor wording changes
  - Sec "Mailing Lists": where to find private archives, closes: #96780
  - Ch "Package uploads":
    - new Sec "Adding an entry to debian/changelog"
    - rename Sec "Announcing new packages" to "New packages"
  - crypto is in main, non-US is for patent restrictions, so:
    - excise some text from "Registering as a Debian developer"
    - changes in Sec "Uploading to ftp-master"
    - changes in Sec "Uploading to non-US"
* old bugs closed out, closes: #110573

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
# rules file for developers-reference
 
3
#
 
4
# I do not use debstd, debhelper, or any of that stuff.
 
5
# I believe in stripped down rules files; nothing that is not required
 
6
# I believe in readability through abstraction
 
7
 
 
8
package         := developers-reference
 
9
 
 
10
# directory abstraction
 
11
prefix          := debian/tmp
 
12
docdir          := $(prefix)/usr/share/doc/$(package)
 
13
docbasedir      := $(prefix)/usr/share/doc-base
 
14
 
 
15
# tool abstraction
 
16
install_file    := install -o root -g root -m 644 -p
 
17
install_script  := install -o root -g root -m 755 -p
 
18
make_directory  := install -d -o root -g root -m 755
 
19
compress        := gzip -9f
 
20
 
 
21
# version abstraction
 
22
DEB_VERSION     := $(shell LC_ALL=C dpkg-parsechangelog | grep '^Version: ' | sed 's/^Version: *//')
 
23
DEB_DATE        := $(shell dpkg-parsechangelog | sed -n 's/^Date: *//p')
 
24
# pretty-print the date; I wish this was dynamic like the top-level makefile but oh well
 
25
DATE_EN         := $(shell LC_ALL=C     date --date="$(DEB_DATE)" '+%d %B, %Y')
 
26
DATE_FR         := $(shell LC_ALL=fr_FR date --date="$(DEB_DATE)" '+%d %B %Y')
 
27
DATE_JA         := $(shell LC_ALL=ja_JP date --date="$(DEB_DATE)" '+%x')
 
28
 
 
29
version.ent:    debian/changelog
 
30
        :> version.ent
 
31
        echo "<!entity version \"$(DEB_VERSION)\">" >> version.ent
 
32
        echo "<!entity date-en \"$(DATE_EN)\">"     >> version.ent
 
33
        echo "<!entity date-fr \"$(DATE_FR)\">"     >> version.ent
 
34
        echo "<!entity date-ja \"$(DATE_JA)\">"     >> version.ent
 
35
 
 
36
build:
 
37
        $(checkdir)
 
38
        $(MAKE)
 
39
        touch build
 
40
 
 
41
clean:
 
42
        $(checkdir)
 
43
        $(MAKE) clean
 
44
        rm -f build
 
45
        rm -rf $(prefix)
 
46
        rm -f debian/files* core debian/substvars
 
47
 
 
48
binary-indep:   build
 
49
        $(checkdir)
 
50
        $(checkroot)
 
51
        rm -rf $(prefix)
 
52
        $(make_directory) $(prefix)/DEBIAN
 
53
        $(make_directory) $(docdir) $(docbasedir)
 
54
 
 
55
        for dir in $(wildcard developers-reference*.html); do \
 
56
                $(make_directory) $(docdir)/$$dir ;\
 
57
                $(install_file) $$dir/*.html $(docdir)/$$dir/ ;\
 
58
        done
 
59
        $(install_file) developers-reference*.txt $(docdir)/
 
60
        $(install_file) developers-reference*.pdf $(docdir)/
 
61
        $(install_file) developers-reference*.sgml version.ent common.ent $(docdir)/
 
62
 
 
63
        $(install_file) debian/copyright $(docdir)/
 
64
        $(install_file) ChangeLog $(docdir)/changelog
 
65
        $(install_file) debian/changelog $(docdir)/changelog.Debian
 
66
        $(install_file) developers-reference.desc $(docbasedir)/$(package)
 
67
 
 
68
#        make sure control files are good
 
69
        sh -n debian/postinst
 
70
        sh -n debian/prerm
 
71
        $(install_script) debian/postinst debian/prerm $(prefix)/DEBIAN/
 
72
 
 
73
#        compress docdir (policy)       
 
74
        find $(docdir) -type f \( -size +4k -or -iname "change*" \)     \
 
75
                ! -name "*.html" ! -name "*.gif" ! -name "*.pdf"        \
 
76
                ! -name "copyright" | xargs $(compress)
 
77
 
 
78
        dpkg-gencontrol -isp
 
79
#        be tricky about putting the TOC sections into the description of the package
 
80
        perl -ne '/^\d+\.\s/ && print "    $$_";' < developers-reference.txt \
 
81
                >> $(prefix)/DEBIAN/control
 
82
 
 
83
        dpkg --build $(prefix) ..
 
84
 
 
85
#        some extra-package files
 
86
        $(install_file) developers-reference.pdf                        \
 
87
          ../developers-reference.pdf.$(DEB_VERSION)
 
88
        dpkg-distaddfile -fdebian/files developers-reference.pdf.$(DEB_VERSION) byhand -
 
89
        GZIP=-9 tar czf ../developers-reference.html.tar.gz.$(DEB_VERSION)\
 
90
          developers-reference.html
 
91
        dpkg-distaddfile -fdebian/files developers-reference.html.tar.gz.$(DEB_VERSION)\
 
92
          byhand -
 
93
        $(install_file) developers-reference.txt                        \
 
94
          ../developers-reference.txt
 
95
        $(compress) ../developers-reference.txt
 
96
        mv ../developers-reference.txt.gz                               \
 
97
          ../developers-reference.txt.gz.$(DEB_VERSION)
 
98
        dpkg-distaddfile -fdebian/files                                 \
 
99
          developers-reference.txt.gz.$(DEB_VERSION) byhand -
 
100
 
 
101
binary-arch:    build
 
102
# There are no architecture-dependent files to be uploaded
 
103
# generated by this package.  If there were any they would be
 
104
# made here.
 
105
 
 
106
define checkdir
 
107
        test -f debian/rules
 
108
        test -f developers-reference.sgml
 
109
endef
 
110
 
 
111
# Below here is fairly generic really
 
112
 
 
113
define checkroot
 
114
        test `id -u` = 0
 
115
endef
 
116
 
 
117
binary:         binary-indep binary-arch
 
118
 
 
119
.PHONY: binary binary-arch binary-indep clean
 
120
 
 
121
#Local variables:
 
122
#mode: makefile
 
123
#End: