Ticket #39018: Portfile.2

File Portfile.2, 4.7 KB (added by cooljeanius (Eric Gallager), 11 years ago)

latest version of portfile for dpkg

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 105815 2013-05-06 14:52:20Z landonf@macports.org $
3
4PortSystem          1.0
5
6name                dpkg
7version             1.16.10
8revision            0
9platforms           darwin freebsd
10categories          sysutils archivers
11license             GPL-2+
12maintainers         gwmail.gwu.edu:egall openmaintainer
13description         Debian package maintenance system
14long_description    ${name} is the basis of the ${description}. Installing this \
15                    port allows the usage of the `port dpkg` command.
16homepage            http://wiki.debian.org/Teams/Dpkg
17
18master_sites        debian:d/${name}/
19checksums           md5     a20a06a5272717274a8b009368f237da \
20                    sha1    bd67ce10236a674a2349d13feaa096b41fea4c9c \
21                    rmd160  e04b3834056cd97c1cb955007f02e1358a8e8fa0 \
22                    sha256  aeaacf0884039940d9463901102194f9a42eb5702157b9e7a23f43e0d9f65cf2
23
24use_xz              yes
25extract.asroot      yes
26
27depends_build-append \
28                    port:pkgconfig \
29                    path:share/aclocal/ax_check_gnu_make.m4:autoconf-archive \
30                    bin:git:git-core
31
32# Use MacPorts versions explicitly
33depends_lib-append  port:gettext \
34                    port:libiconv \
35                    port:perl5 \
36                    port:coreutils \
37                    port:bzip2 \
38                    port:zlib \
39                    port:ncurses \
40                    port:gnutar \
41                    path:lib/pkgconfig/liblzma.pc:xz
42
43depends_run-append  bin:gnutar:gnutar \
44                    bin:lzma:xz \
45                    port:debianutils
46
47# got to do some underscore-to-hyphen twiddling...
48distname            ${name}_${version}
49worksrcdir          ${name}-${version}
50
51configure.env-append \
52                    PERL=${prefix}/bin/perl5 \
53                    PKG_CONFIG=${prefix}/bin/pkg-config \
54                    TAR=${prefix}/bin/gnutar
55configure.args-append \
56                    --with-libintl-prefix=${prefix} \
57                    --with-libiconv-prefix=${prefix} \
58                    --with-admindir=${prefix}/var/db/${name} \
59                    --with-logdir=${prefix}/var/log \
60                    --mandir=${prefix}/share/man \
61                    --with-zlib --with-bz2 --with-liblzma \
62                    --disable-linker-optimisations \
63                    --disable-silent-rules \
64                    --disable-start-stop-daemon
65# The start-stop-daemon patch now applies again, but now it leads to build errors,
66# so disabling it with a configure flag again
67
68build.type          gnu
69
70set vardpkg ${destroot}${prefix}/var/db/${name}
71destroot.keepdirs ${vardpkg} ${vardpkg}/updates ${vardpkg}/info ${prefix}/var/log
72
73patchfiles-append   patch-configure.ac.diff \
74                    patch-lib_dpkg_dpkg.h.diff \
75                    patch-lib_dpkg_tarfn.c.diff \
76                    patch-src_remove.c.diff \
77                    patch-src_archives.c.diff \
78                    patch-utils_start-stop-daemon.c.diff
79
80post-patch {
81    set scripts ${worksrcpath}/scripts
82    reinplace s|/etc/${name}/|${prefix}/etc/${name}/| \
83            ${scripts}/${name}-shlibdeps.pl \
84            ${scripts}/${name}-source.pl
85    file copy ${prefix}/share/aclocal/ax_check_gnu_make.m4 ${worksrcpath}/m4
86    system -W ${worksrcpath} "git init"
87}
88
89use_autoreconf      yes
90autoreconf.args     -fvi
91
92pre-destroot {
93    file mkdir ${destroot}${prefix}/share/doc/${name}
94}
95
96post-destroot {
97    file mkdir ${vardpkg}
98    file mkdir ${vardpkg}/updates
99    file mkdir ${vardpkg}/info
100    system "touch ${vardpkg}/available ${vardpkg}/status"
101}
102
103platform darwin {
104    depends_build-append    bin:gnumake:gmake
105}
106
107platform freebsd {
108    depends_build-append    bin:gmake:gmake
109}
110
111# This variant currently hangs while building and fails to actually install the documentation,
112# not entirely sure why...
113variant docs description {Build documentation} {
114    depends_build-append    port:doxygen path:bin/dot:graphviz
115    set docdir ${prefix}/share/doc/${name}
116    configure.args-append   --docdir=${docdir} \
117                            --htmldir=${docdir}/html \
118                            --dvidir=${docdir}/dvi \
119                            --pdfdir=${docdir}/pdf \
120                            --psdir=${docdir}/ps
121    build.target-append     doc
122    post-build {
123        system -W ${worksrcpath}/doc "doxygen"
124    }
125}
126
127# Tests currently fail, this needs to be fixed
128test.run            yes
129test.target         check
130
131livecheck.type      regex
132livecheck.url       http://ftp.debian.org/debian/pool/main/d/${name}/
133livecheck.regex     "${name}_(\\d+\\.\\d+(\\.\\d+)*)"