source: trunk/dports/sysutils/apt/Portfile @ 28548

Last change on this file since 28548 was 28548, checked in by mww@…, 12 years ago

replace configure.env as far as possible

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.6 KB
Line 
1# $Id: Portfile 28548 2007-09-03 13:34:51Z mww@macports.org $
2# Thanks to the Fink Project for their work on porting apt
3
4PortSystem 1.0
5name                    apt
6version                 0.5.27
7revision                7
8platforms               darwin freebsd
9categories              sysutils
10maintainers             landonf@macports.org
11description             Advanced front-end for dpkg
12long_description        Apt is Debian's next generation front-end for the \
13                        dpkg package manager. It provides the apt-get utility \
14                        and APT dselect method that provides a simpler, safer \
15                        way to install and upgrade packages.
16homepage                http://www.debian.org/
17
18master_sites            http://ftp.debian.org/debian/pool/main/a/apt/
19checksums               md5 36f0b6012806569d27be98c80a6d57ff
20distname                ${name}_${version}
21worksrcdir              ${name}-${version}
22
23depends_lib             path:${prefix}/bin/dpkg:dpkg \
24                        bin:bash:bash
25
26patchfiles              ostable.diff \
27                        paths.diff \
28                        patch-aclocal.m4 \
29                        patch-configure.in \
30                        patch-configure \
31                        patch-static-constructors \
32                        soname-magic.diff
33
34# Work around case insensitive file system issues
35configure.cmd           ../configure
36configure.dir           ${worksrcpath}/build
37pre-configure           { file mkdir ${worksrcpath}/build }
38
39configure.cflags-append "-L${prefix}/lib"
40configure.cxxflags-append "-D__USE_MISC"
41
42configure.args          --without-sgml-doc --disable-rpath
43
44build.dir               ${configure.dir}
45build.type              gnu
46
47set varapt              ${destroot}${prefix}/var/db/apt
48destroot.keepdirs       ${varapt} \
49                        ${varapt}/cache/archives/partial \
50                        ${varapt}/state/lists/partial \
51                        ${destroot}/${prefix}/etc/apt \
52                        ${destroot}/${prefix}/etc/apt/apt.conf.d
53
54### Operating System Variants ###
55platform darwin {
56        global aptpkg-longversion aptpkg-version aptpkg-shortversion
57        global aptinst-longversion aptinst-version aptinst-shortversion
58        global apt-libsuffix
59
60        set apt-libsuffix       dylib
61
62        set aptpkg-longversion  3.3.0.dylib
63        set aptpkg-version      3.3.dylib
64        set aptpkg-shortversion 3.dylib
65
66        set aptinst-longversion         1.0.0.dylib
67        set aptinst-version             1.0.dylib
68        set aptinst-shortversion        1.dylib
69
70        depends_lib-append      port:gettext
71        depends_build-append    bin:gnumake:gmake
72        # c++pragma.diff generated with the following, provided by
73        # Peter O'Gorman:
74        # for i in `grep -rl '#ifdef __GNUG__' .` ; do perl -pi -e 's/#ifdef
75        # __GNUG__/#if defined(__GNUG__) && !defined(__APPLE_CC__)/' $i; done
76        patchfiles-append       sig_t.diff \
77                                c++pragma.diff \
78                                darwinshlibs-hack.diff \
79                                use-libintl.diff
80}
81
82platform freebsd {
83        global aptpkg-longversion aptpkg-version aptpkg-shortversion
84        global aptinst-longversion aptinst-version aptinst-shortversion
85        global apt-libsuffix
86
87        set apt-libsuffix       so
88
89        set aptpkg-longversion  so.3.3.0
90        set aptpkg-version      so.3.3
91        set aptpkg-shortversion so.3
92
93        set aptinst-longversion         so.1.0.0
94        set aptinst-version             so.1.0
95        set aptinst-shortversion        so.1
96
97        depends_lib-append      port:gettext
98        depends_build-append    bin:gmake:gmake
99        patchfiles-append       sig_t.diff \
100                                use-libintl.diff
101}
102
103### Target Overrides ###
104post-patch {
105        reinplace "s|@PREFIX@|${prefix}|g" \
106                        ${worksrcpath}/buildlib/environment.mak.in \
107                        ${worksrcpath}/apt-pkg/deb/debsystem.cc \
108                        ${worksrcpath}/apt-pkg/init.cc \
109                        ${worksrcpath}/dselect/install \
110                        ${worksrcpath}/dselect/setup \
111                        ${worksrcpath}/dselect/update
112        # Hack for lack of post-patch-append
113        if {[variant_isset freebsd]} {
114                reinplace "s|make -s|gmake -s|g" ${worksrcpath}/configure
115        }
116}
117
118# apt's makefiles do not have an install target
119destroot {
120        set build ${build.dir}
121
122        # Install binaries
123        set bindest ${destroot}${prefix}/bin/
124        file mkdir ${bindest}
125        xinstall -m 755 ${build}/bin/apt-cache ${bindest}
126        xinstall -m 755 ${build}/bin/apt-cdrom ${bindest}
127        xinstall -m 755 ${build}/bin/apt-config ${bindest}
128        xinstall -m 755 ${build}/bin/apt-extracttemplates ${bindest}
129        xinstall -m 755 ${build}/bin/apt-get ${bindest}
130        xinstall -m 755 ${build}/bin/apt-sortpkgs ${bindest}
131
132        # Install libraries
133        set libdest ${destroot}${prefix}/lib/
134        file mkdir ${libdest}
135
136        xinstall -m 644 ${build}/bin/libapt-pkg.${aptpkg-longversion} ${libdest}
137        system  "cd ${libdest} && \
138                 ln -sf libapt-pkg.${aptpkg-longversion} libapt-pkg.${aptpkg-version} && \
139                 ln -sf libapt-pkg.${aptpkg-version} libapt-pkg.${aptpkg-shortversion} && \
140                 ln -sf libapt-pkg.${aptpkg-shortversion} libapt-pkg.${apt-libsuffix}"
141
142        xinstall -m 644 ${build}/bin/libapt-inst.${aptinst-longversion} ${libdest}
143        system  "cd ${libdest} && \
144                 ln -sf libapt-inst.${aptinst-longversion} libapt-inst.${aptinst-version} && \
145                 ln -sf libapt-inst.${aptinst-version} libapt-inst.${aptinst-shortversion} && \
146                 ln -sf libapt-inst.${aptinst-shortversion} libapt-inst.${apt-libsuffix}"
147
148        # Install methods
149        set methdest ${destroot}${prefix}/libexec/apt/methods/
150        file mkdir ${methdest}
151        xinstall -m 755 ${build}/bin/methods/cdrom ${methdest}
152        xinstall -m 755 ${build}/bin/methods/copy ${methdest}
153        xinstall -m 755 ${build}/bin/methods/file ${methdest}
154        xinstall -m 755 ${build}/bin/methods/ftp ${methdest}
155        xinstall -m 755 ${build}/bin/methods/gzip ${methdest}
156        xinstall -m 755 ${build}/bin/methods/http ${methdest}
157        xinstall -m 755 ${build}/bin/methods/rsh ${methdest}
158        system  "cd ${methdest} && \
159                 ln -sf rsh ssh"
160
161        file mkdir ${methdest}/apt
162        xinstall -m 644 ${build}/scripts/dselect/desc.apt ${methdest}/apt/
163        xinstall -m 755 ${build}/scripts/dselect/install ${methdest}/apt/
164        xinstall -m 644 ${build}/scripts/dselect/names ${methdest}/apt/
165        xinstall -m 755 ${build}/scripts/dselect/setup ${methdest}/apt/
166        xinstall -m 755 ${build}/scripts/dselect/update ${methdest}/apt/
167
168        # Install includes
169        set incdest ${destroot}${prefix}/include/apt-pkg/
170        file mkdir ${incdest}
171        foreach file [readdir ${build}/include/apt-pkg/] {
172                if {"$file" == "." || "$file" == ".."} {
173                        continue
174                }
175                xinstall -m 644 ${build}/include/apt-pkg/${file} \
176                        ${incdest}
177        }
178
179        # Install man pages
180        set mandest ${destroot}${prefix}/share/man
181        file mkdir ${mandest}
182        file mkdir ${mandest}/man1
183        file mkdir ${mandest}/man5
184        file mkdir ${mandest}/man8
185        xinstall -m 644 ${build}/docs/apt-cache.8 \
186                        ${build}/docs/apt-cdrom.8 \
187                        ${build}/docs/apt-config.8 \
188                        ${build}/docs/apt-get.8 \
189                                ${mandest}/man8/
190
191        xinstall -m 644 ${build}/docs/apt-extracttemplates.1 \
192                        ${build}/docs/apt-ftparchive.1 \
193                        ${build}/docs/apt-sortpkgs.1 \
194                                ${mandest}/man1/
195
196        xinstall -m 644 ${build}/docs/apt.conf.5 \
197                        ${build}/docs/apt_preferences.5 \
198                        ${build}/docs/sources.list.5 \
199                        ${build}/docs/vendors.list.5 \
200                                ${mandest}/man5/
201
202        # Install configuration files
203        set confdest ${destroot}/${prefix}/etc/apt/apt.conf.d
204        file mkdir ${confdest}
205        xinstall -m 644 ${filespath}/sources.list ${destroot}/${prefix}/etc/apt/sources.list
206        xinstall -m 644 ${worksrcpath}/build/docs/examples/apt.conf ${destroot}/${prefix}/etc/apt/apt.conf
207
208        # Create var directoriesa
209        file mkdir ${destroot}${prefix}/var/db/apt/cache/archives/partial
210        file mkdir ${destroot}${prefix}/var/db/apt/state/lists/partial
211}
Note: See TracBrowser for help on using the repository browser.