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

Last change on this file since 9875 was 9875, checked in by landonf, 15 years ago

Fix incorrect paths

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