ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/apt.spec
Revision: 1.7
Committed: Mon Jun 18 17:00:21 2007 UTC (17 years, 10 months ago) by eulisse
Branch: MAIN
Changes since 1.6: +94 -0 lines
Log Message:
Creates the configuration files and wrappers.

File Contents

# Content
1 ### RPM external apt 0.5.15lorg3.2
2 ## INITENV SET APT_CONFIG %{i}/etc/apt/apt.conf
3
4 Source: http://apt-rpm.org/releases/%n-%v.tar.bz2
5 Patch0: apt-rpm449
6 Requires: libxml2 beecrypt rpm zlib bz2lib
7 %if "%(echo %{cmsos} | cut -d_ -f 2 | sed -e 's|.*64.*|64|')" == "64"
8 %define libdir lib64
9 %else
10 %define libdir lib
11 %endif
12
13 %prep
14 %setup -n %n-%{realversion}
15 %patch0 -p0
16 %build
17 export CPPFLAGS="-I$BEECRYPT_ROOT/include -I$RPM_ROOT/include -I$RPM_ROOT/include/rpm"
18 export LDFLAGS="-L$BEECRYPT_ROOT/%{libdir} -L$RPM_ROOT/%{libdir}"
19 export LIBDIR="$LIBS"
20 export LIBXML2_CFLAGS="-I$LIBXML2_ROOT/include/libxml2 -I$BEECRYPT_ROOT/include -I$RPM_ROOT/include"
21 export LIBXML2_LIBS="-lxml2 -L$LIBXML2_ROOT/lib -L$BEECRYPT_ROOT/%{libdir} -L$RPM_ROOT/%{libdir}"
22
23 ./configure --prefix=%{i} --exec-prefix=%{i} \
24 --disable-nls \
25 --disable-dependency-tracking \
26 --without-libintl-prefix \
27 --disable-rpath
28 make %makeprocesses
29
30
31 %install
32 make install
33 mkdir -p %{i}/etc/profile.d
34 (echo "#!/bin/sh"; \
35 echo "source $RPM_ROOT/etc/profile.d/init.sh"; \
36 echo "source $LIBXML2_ROOT/etc/profile.d/init.sh" ) > %{i}/etc/profile.d/dependencies-setup.sh
37 (echo "#!/bin/tcsh"; \
38 echo "source $RPM_ROOT/etc/profile.d/init.csh"; \
39 echo "source $LIBXML2_ROOT/etc/profile.d/init.csh" ) > %{i}/etc/profile.d/dependencies-setup.csh
40
41 mkdir -p %{i}/etc/apt
42 cat << \EOF_APT_CONF > %{i}/etc/apt/apt.conf
43 Dir "%{instroot}"
44 {
45 // Location of the state dir
46 State "%{cmsplatf}/var/lib/apt/"
47 {
48 lists "lists/";
49 xstatus "xstatus";
50 userstatus "status.user";
51 status "var/lib/dpkg/status";
52 cdroms "cdroms.list";
53 };
54
55 // Location of the cache dir
56 Cache "%{cmsplatf}/var/lib/cache" {
57 archives "%{cmsplatf}";
58 srcpkgcache "srcpkgcache.bin";
59 pkgcache "pkgcache.bin";
60 };
61
62 // Locations of binaries
63 Bin {
64 methods "%{i}%{libdir}/apt/methods/";
65 gzip "/bin/gzip";
66 dpkg "/usr/bin/dpkg";
67 dpkg-source "/usr/bin/dpkg-source";
68 dpkg-buildpackage "/usr/bin/dpkg-buildpackage";
69 apt-get "%{instroot}/bin/apt-get-wrapper";
70 apt-cache "%{instroot}/bin/apt-cache-wrapper";
71 rpm "%{instroot}/bin/rpm-wrapper";
72 };
73
74
75 // Config files
76 Etc "%{cmsplatf}/etc/apt/" {
77 sourcelist "sources.list";
78 main "apt.conf";
79 preferences "preferences";
80 };
81 };
82
83 Debug::pkgProblemResolver="1";
84
85 RPM
86 {
87 PM "external";
88 Options { "--define";"_rpmlock_path %{instroot}/%{cmsplatf}/var/lib/rpm/lock";"--dbpath";"%{instroot}/var/lib/rpm";"--nodeps";};
89 Install-Options { "--define";"_rpmlock_path %{instroot}/%{cmsplatf}/var/lib/rpm/lock";"--nodeps";"--force";"--dbpath";"%{instroot}/%{cmsplatf}/var/lib/rpm";"--prefix";"%{instroot}";};
90 RootDir "%{instroot}";
91 Architecture "%{cmsplatf}";
92 };
93 EOF_APT_CONF
94
95 %post
96 mkdir -p %{cmsplatf}/var/lib/apt/lists/partial
97 mkdir -p %{cmsplatf}/var/lib/rpm
98 mkdir -p %{cmsplatf}/var/lib/cache/%{cmsplatf}/partial
99 mkdir -p %{cmsplatf}/etc/apt
100 mkdir -p %{cmsplatf}/etc/rpm
101 mkdir -p %{cmsplatf}/lib/apt/methods
102 mkdir -p %{cmsplatf}/var/lib/dpkg/status
103 mkdir -p bin
104 mkdir -p %{cmsplatf}/var/lib/cache/%{cmsplatf}
105
106 cat << \EOF_BIN_APT_CACHE_WRAPPER > bin/apt-cache-wrapper
107 #!/bin/sh
108 touch %{instroot}/log.txt
109 echo $@ >> %{instroot}/log.txt
110 apt-cache $@
111 EOF_BIN_APT_CACHE_WRAPPER
112 chmod +x bin/apt-cache-wrapper
113
114 cat << \EOF_BIN_APT_GET_WRAPPER > bin/apt-get-wrapper
115 #!/bin/sh
116 touch %{instroot}/log.txt
117 echo $@ >> %{instroot}/log.txt
118 apt-get $@
119 EOF_BIN_APT_GET_WRAPPER
120 chmod +x bin/apt-get-wrapper
121
122 mkdir -p %{cmsplatf}/etc/apt
123 cat << \EOF_RPMPRIORITIES > %{cmsplatf}/etc/apt/rpmpriorities
124 Essantial:
125
126 EOF_RPMPRIORITIES
127
128 mkdir -p %{cmsplatf}/var/lib/rpm
129
130 %{relocateConfig}etc/profile.d/dependencies-setup.sh
131 %{relocateConfig}etc/profile.d/dependencies-setup.csh
132 perl -p -i -e "s|%{instroot}|$RPM_INSTALL_PREFIX|" bin/apt-cache-wrapper bin/apt-get-wrapper