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

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

Change variant darwin to platform darwin

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.7 KB
Line 
1# $Id: Portfile 26898 2007-07-11 05:23:51Z yves@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.env           CPPFLAGS="-I${prefix}/include" \
40                        CFLAGS="-L${prefix}/lib" \
41                        LDFLAGS="-L${prefix}/lib" \
42                        CXXFLAGS="-D__USE_MISC"
43
44configure.args          --without-sgml-doc --disable-rpath
45
46build.dir               ${configure.dir}
47build.type              gnu
48
49set varapt              ${destroot}${prefix}/var/db/apt
50destroot.keepdirs       ${varapt} \
51                        ${varapt}/cache/archives/partial \
52                        ${varapt}/state/lists/partial \
53                        ${destroot}/${prefix}/etc/apt \
54                        ${destroot}/${prefix}/etc/apt/apt.conf.d
55
56### Operating System Variants ###
57platform darwin {
58        global aptpkg-longversion aptpkg-version aptpkg-shortversion
59        global aptinst-longversion aptinst-version aptinst-shortversion
60        global apt-libsuffix
61
62        set apt-libsuffix       dylib
63
64        set aptpkg-longversion  3.3.0.dylib
65        set aptpkg-version      3.3.dylib
66        set aptpkg-shortversion 3.dylib
67
68        set aptinst-longversion         1.0.0.dylib
69        set aptinst-version             1.0.dylib
70        set aptinst-shortversion        1.dylib
71
72        depends_lib-append      port:gettext
73        depends_build-append    bin:gnumake:gmake
74        # c++pragma.diff generated with the following, provided by
75        # Peter O'Gorman:
76        # for i in `grep -rl '#ifdef __GNUG__' .` ; do perl -pi -e 's/#ifdef
77        # __GNUG__/#if defined(__GNUG__) && !defined(__APPLE_CC__)/' $i; done
78        patchfiles-append       sig_t.diff \
79                                c++pragma.diff \
80                                darwinshlibs-hack.diff \
81                                use-libintl.diff
82}
83
84platform freebsd {
85        global aptpkg-longversion aptpkg-version aptpkg-shortversion
86        global aptinst-longversion aptinst-version aptinst-shortversion
87        global apt-libsuffix
88
89        set apt-libsuffix       so
90
91        set aptpkg-longversion  so.3.3.0
92        set aptpkg-version      so.3.3
93        set aptpkg-shortversion so.3
94
95        set aptinst-longversion         so.1.0.0
96        set aptinst-version             so.1.0
97        set aptinst-shortversion        so.1
98
99        depends_lib-append      port:gettext
100        depends_build-append    bin:gmake:gmake
101        patchfiles-append       sig_t.diff \
102                                use-libintl.diff
103}
104
105### Target Overrides ###
106post-patch {
107        reinplace "s|@PREFIX@|${prefix}|g" \
108                        ${worksrcpath}/buildlib/environment.mak.in \
109                        ${worksrcpath}/apt-pkg/deb/debsystem.cc \
110                        ${worksrcpath}/apt-pkg/init.cc \
111                        ${worksrcpath}/dselect/install \
112                        ${worksrcpath}/dselect/setup \
113                        ${worksrcpath}/dselect/update
114        # Hack for lack of post-patch-append
115        if {[variant_isset freebsd]} {
116                reinplace "s|make -s|gmake -s|g" ${worksrcpath}/configure
117        }
118}
119
120# apt's makefiles do not have an install target
121destroot {
122        set build ${build.dir}
123
124        # Install binaries
125        set bindest ${destroot}${prefix}/bin/
126        file mkdir ${bindest}
127        xinstall -m 755 ${build}/bin/apt-cache ${bindest}
128        xinstall -m 755 ${build}/bin/apt-cdrom ${bindest}
129        xinstall -m 755 ${build}/bin/apt-config ${bindest}
130        xinstall -m 755 ${build}/bin/apt-extracttemplates ${bindest}
131        xinstall -m 755 ${build}/bin/apt-get ${bindest}
132        xinstall -m 755 ${build}/bin/apt-sortpkgs ${bindest}
133
134        # Install libraries
135        set libdest ${destroot}${prefix}/lib/
136        file mkdir ${libdest}
137
138        xinstall -m 644 ${build}/bin/libapt-pkg.${aptpkg-longversion} ${libdest}
139        system  "cd ${libdest} && \
140                 ln -sf libapt-pkg.${aptpkg-longversion} libapt-pkg.${aptpkg-version} && \
141                 ln -sf libapt-pkg.${aptpkg-version} libapt-pkg.${aptpkg-shortversion} && \
142                 ln -sf libapt-pkg.${aptpkg-shortversion} libapt-pkg.${apt-libsuffix}"
143
144        xinstall -m 644 ${build}/bin/libapt-inst.${aptinst-longversion} ${libdest}
145        system  "cd ${libdest} && \
146                 ln -sf libapt-inst.${aptinst-longversion} libapt-inst.${aptinst-version} && \
147                 ln -sf libapt-inst.${aptinst-version} libapt-inst.${aptinst-shortversion} && \
148                 ln -sf libapt-inst.${aptinst-shortversion} libapt-inst.${apt-libsuffix}"
149
150        # Install methods
151        set methdest ${destroot}${prefix}/libexec/apt/methods/
152        file mkdir ${methdest}
153        xinstall -m 755 ${build}/bin/methods/cdrom ${methdest}
154        xinstall -m 755 ${build}/bin/methods/copy ${methdest}
155        xinstall -m 755 ${build}/bin/methods/file ${methdest}
156        xinstall -m 755 ${build}/bin/methods/ftp ${methdest}
157        xinstall -m 755 ${build}/bin/methods/gzip ${methdest}
158        xinstall -m 755 ${build}/bin/methods/http ${methdest}
159        xinstall -m 755 ${build}/bin/methods/rsh ${methdest}
160        system  "cd ${methdest} && \
161                 ln -sf rsh ssh"
162
163        file mkdir ${methdest}/apt
164        xinstall -m 644 ${build}/scripts/dselect/desc.apt ${methdest}/apt/
165        xinstall -m 755 ${build}/scripts/dselect/install ${methdest}/apt/
166        xinstall -m 644 ${build}/scripts/dselect/names ${methdest}/apt/
167        xinstall -m 755 ${build}/scripts/dselect/setup ${methdest}/apt/
168        xinstall -m 755 ${build}/scripts/dselect/update ${methdest}/apt/
169
170        # Install includes
171        set incdest ${destroot}${prefix}/include/apt-pkg/
172        file mkdir ${incdest}
173        foreach file [readdir ${build}/include/apt-pkg/] {
174                if {"$file" == "." || "$file" == ".."} {
175                        continue
176                }
177                xinstall -m 644 ${build}/include/apt-pkg/${file} \
178                        ${incdest}
179        }
180
181        # Install man pages
182        set mandest ${destroot}${prefix}/share/man
183        file mkdir ${mandest}
184        file mkdir ${mandest}/man1
185        file mkdir ${mandest}/man5
186        file mkdir ${mandest}/man8
187        xinstall -m 644 ${build}/docs/apt-cache.8 \
188                        ${build}/docs/apt-cdrom.8 \
189                        ${build}/docs/apt-config.8 \
190                        ${build}/docs/apt-get.8 \
191                                ${mandest}/man8/
192
193        xinstall -m 644 ${build}/docs/apt-extracttemplates.1 \
194                        ${build}/docs/apt-ftparchive.1 \
195                        ${build}/docs/apt-sortpkgs.1 \
196                                ${mandest}/man1/
197
198        xinstall -m 644 ${build}/docs/apt.conf.5 \
199                        ${build}/docs/apt_preferences.5 \
200                        ${build}/docs/sources.list.5 \
201                        ${build}/docs/vendors.list.5 \
202                                ${mandest}/man5/
203
204        # Install configuration files
205        set confdest ${destroot}/${prefix}/etc/apt/apt.conf.d
206        file mkdir ${confdest}
207        xinstall -m 644 ${filespath}/sources.list ${destroot}/${prefix}/etc/apt/sources.list
208        xinstall -m 644 ${worksrcpath}/build/docs/examples/apt.conf ${destroot}/${prefix}/etc/apt/apt.conf
209
210        # Create var directoriesa
211        file mkdir ${destroot}${prefix}/var/db/apt/cache/archives/partial
212        file mkdir ${destroot}${prefix}/var/db/apt/state/lists/partial
213}
Note: See TracBrowser for help on using the repository browser.