source: trunk/dports/sysutils/apt/Portfile

Last change on this file was 124617, checked in by jmr@…, 3 years ago

apt: license

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