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

Last change on this file since 114325 was 114325, checked in by ryandesign@…, 6 years ago

use eq and ne instead of == and != when comparing ${os.platform} and ${os.subplatform}

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