| 21 | | A /users/bruno/pb/projects/buffer/pbconf/1.19/pkg1 |
| 22 | | A /users/bruno/pb/projects/buffer/pbconf/1.19/pkg1/rpm |
| 23 | | A /users/bruno/pb/projects/buffer/pbconf/1.19/pkg1/rpm/pkg1.spec |
| 24 | | A /users/bruno/pb/projects/buffer/pbconf/1.19/pkg1/deb |
| 25 | | A /users/bruno/pb/projects/buffer/pbconf/1.19/pkg1/deb/changelog |
| 26 | | A /users/bruno/pb/projects/buffer/pbconf/1.19/pkg1/deb/control |
| 27 | | A /users/bruno/pb/projects/buffer/pbconf/1.19/pkg1/deb/pkg1.dirs |
| 28 | | A /users/bruno/pb/projects/buffer/pbconf/1.19/pkg1/deb/pkg1.docs |
| 29 | | A /users/bruno/pb/projects/buffer/pbconf/1.19/pkg1/deb/compat |
| 30 | | A /users/bruno/pb/projects/buffer/pbconf/1.19/pkg1/deb/rules |
| 31 | | A /users/bruno/pb/projects/buffer/pbconf/1.19/pkg1/deb/copyright |
| 32 | | A /users/bruno/pb/projects/buffer/pbconf/1.19/pkg1/pbfilter |
| | 21 | A /users/bruno/pb/projects/buffer/pbconf/1.19/buffer |
| | 22 | A /users/bruno/pb/projects/buffer/pbconf/1.19/buffer/rpm |
| | 23 | A /users/bruno/pb/projects/buffer/pbconf/1.19/buffer/rpm/buffer.spec |
| | 24 | A /users/bruno/pb/projects/buffer/pbconf/1.19/buffer/deb |
| | 25 | A /users/bruno/pb/projects/buffer/pbconf/1.19/buffer/deb/changelog |
| | 26 | A /users/bruno/pb/projects/buffer/pbconf/1.19/buffer/deb/control |
| | 27 | A /users/bruno/pb/projects/buffer/pbconf/1.19/buffer/deb/buffer.dirs |
| | 28 | A /users/bruno/pb/projects/buffer/pbconf/1.19/buffer/deb/buffer.docs |
| | 29 | A /users/bruno/pb/projects/buffer/pbconf/1.19/buffer/deb/compat |
| | 30 | A /users/bruno/pb/projects/buffer/pbconf/1.19/buffer/deb/rules |
| | 31 | A /users/bruno/pb/projects/buffer/pbconf/1.19/buffer/deb/copyright |
| | 32 | A /users/bruno/pb/projects/buffer/pbconf/1.19/buffer/pbfilter |
| 52 | | Ajout buffer/pbconf/1.19/pkg1 |
| 53 | | Ajout buffer/pbconf/1.19/pkg1/deb |
| 54 | | Ajout buffer/pbconf/1.19/pkg1/deb/changelog |
| 55 | | Ajout buffer/pbconf/1.19/pkg1/deb/compat |
| 56 | | Ajout buffer/pbconf/1.19/pkg1/deb/control |
| 57 | | Ajout buffer/pbconf/1.19/pkg1/deb/copyright |
| 58 | | Ajout buffer/pbconf/1.19/pkg1/deb/pkg1.dirs |
| 59 | | Ajout buffer/pbconf/1.19/pkg1/deb/pkg1.docs |
| 60 | | Ajout buffer/pbconf/1.19/pkg1/deb/rules |
| 61 | | Ajout buffer/pbconf/1.19/pkg1/pbfilter |
| 62 | | Ajout buffer/pbconf/1.19/pkg1/rpm |
| 63 | | Ajout buffer/pbconf/1.19/pkg1/rpm/pkg1.spec |
| | 52 | Ajout buffer/pbconf/1.19/buffer |
| | 53 | Ajout buffer/pbconf/1.19/buffer/deb |
| | 54 | Ajout buffer/pbconf/1.19/buffer/deb/changelog |
| | 55 | Ajout buffer/pbconf/1.19/buffer/deb/compat |
| | 56 | Ajout buffer/pbconf/1.19/buffer/deb/control |
| | 57 | Ajout buffer/pbconf/1.19/buffer/deb/copyright |
| | 58 | Ajout buffer/pbconf/1.19/buffer/deb/buffer.dirs |
| | 59 | Ajout buffer/pbconf/1.19/buffer/deb/buffer.docs |
| | 60 | Ajout buffer/pbconf/1.19/buffer/deb/rules |
| | 61 | Ajout buffer/pbconf/1.19/buffer/pbfilter |
| | 62 | Ajout buffer/pbconf/1.19/buffer/rpm |
| | 63 | Ajout buffer/pbconf/1.19/buffer/rpm/pkg1.spec |
| | 92 | We also need to adapt the filter a bit: |
| | 93 | {{{ |
| | 94 | grep -Ev '^#|^$' buffer/pbconf/1.19/pbfilter/* |
| | 95 | buffer/pbconf/1.19/pbfilter/all.pbf:filter PBREPO = $pbrepo |
| | 96 | buffer/pbconf/1.19/pbfilter/all.pbf:filter PBSRC = src/%{name}-%{version}.tar.gz |
| | 97 | buffer/pbconf/1.19/pbfilter/all.pbf:filter PBVER = $pbver |
| | 98 | buffer/pbconf/1.19/pbfilter/all.pbf:filter PBDATE = $pbdate |
| | 99 | buffer/pbconf/1.19/pbfilter/all.pbf:filter PBLOG = yes |
| | 100 | buffer/pbconf/1.19/pbfilter/all.pbf:filter PBTAG = $pbtag |
| | 101 | buffer/pbconf/1.19/pbfilter/all.pbf:filter PBREV = $pbrev |
| | 102 | buffer/pbconf/1.19/pbfilter/all.pbf:filter PBPKG = $pbpkg |
| | 103 | buffer/pbconf/1.19/pbfilter/all.pbf:filter PBPACKAGER = $pbpackager |
| | 104 | buffer/pbconf/1.19/pbfilter/all.pbf:filter PBDESC = This is a program designed to speed up writing tapes on remote tape drives. When this program is put "in the pipe", two processes are started. One process reads from standard-in and the other writes to standard-out. Both processes communicate via shared memory. |
| | 105 | buffer/pbconf/1.19/pbfilter/all.pbf:filter PBURL = http://hello-penguin.com/software/buffer |
| | 106 | buffer/pbconf/1.19/pbfilter/deb.pbf:filter PBGRP = utils |
| | 107 | buffer/pbconf/1.19/pbfilter/md.pbf:filter PBGRP = Archiving/Backup |
| | 108 | buffer/pbconf/1.19/pbfilter/novell.pbf:filter PBGRP = Productivity/Archiving/Backup |
| | 109 | buffer/pbconf/1.19/pbfilter/rpm.pbf:filter PBGRP = Applications/Archiving |
| | 110 | buffer/pbconf/1.19/pbfilter/rpm.pbf:filter PBSUF = $pbsuf |
| | 111 | }}} |
| | 112 | |
| | 113 | This defines all the macro that are needed to do a build. |
| | 114 | Then adapt the spec file if you're on a rpm based distro, or the control file if under a deb one. |
| | 115 | I'm using Mandriva so go for the spec: |
| | 116 | {{{ |
| | 117 | grep -Ev '^#|^$' buffer/pbconf/1.19/buffer/rpm/buffer.spec |
| | 118 | Summary: buffer speeds up writing tapes on remote tape drives |
| | 119 | Summary(fr): buffer accélère l'écriture des bande sur des périphériques distants |
| | 120 | Name: PBPKG |
| | 121 | Version: PBVER |
| | 122 | Release: PBTAGPBSUF |
| | 123 | License: PBLIC |
| | 124 | Group: PBGRP |
| | 125 | Url: PBURL |
| | 126 | Source: PBREPO/PBSRC |
| | 127 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n) |
| | 128 | %description |
| | 129 | PBDESC |
| | 130 | %description -l fr |
| | 131 | buffer accélère l'écriture des bande sur des périphériques distants |
| | 132 | %prep |
| | 133 | %setup -q |
| | 134 | %build |
| | 135 | make %{?_smp_mflags} |
| | 136 | %install |
| | 137 | %{__rm} -rf $RPM_BUILD_ROOT |
| | 138 | install -m 755 -D buffer $RPM_BUILD_ROOT%{_bindir}/buffer |
| | 139 | install -m 644 -D buffer.man $RPM_BUILD_ROOT%{_mandir}/man1/buffer.1 |
| | 140 | %clean |
| | 141 | %{__rm} -rf $RPM_BUILD_ROOT |
| | 142 | %files |
| | 143 | %defattr(-,root,root) |
| | 144 | %doc ChangeLog |
| | 145 | %doc COPYING README AUTHORS NEWS |
| | 146 | %{_bindir}/buffer |
| | 147 | %{_mandir}/man1/buffer.1* |
| | 148 | %changelog |
| | 149 | PBLOG |
| | 150 | }}} |
| | 151 | |
| | 152 | As you can see globally only few changes :-) |
| | 153 | Now it's time to test the result of our configuration: |
| | 154 | {{{ |
| | 155 | pb -p buffer cms2build |
| | 156 | Project: buffer |
| | 157 | Action: cms2build |
| | 158 | Packages: buffer |
| | 159 | |
| | 160 | Management of buffer 1.19-1 (rev flat) |
| | 161 | ... 2008-05-30 02:18:28 URL:http://hello-penguin.com/software/buffer/buffer-1.19.tar.gz [17920/17920] -> "/users/bruno/tmp/pb.jh8U7Q7VdP/buffer-1.19.tar.gz" [1] |
| | 162 | OK |
| | 163 | Extracting /users/bruno/tmp/pb.jh8U7Q7VdP/buffer-1.19.tar.gz in /users/bruno/pb/projects/buffer/delivery... OK |
| | 164 | Generating fake ChangeLog for test version |
| | 165 | Build files generated for debian-3.1,debian-4.0,fedora-4,fedora-5,fedora-6,fedora-7,fedora-8,fedora-9,mandrake-10.1,mandrake-10.2,mandriva-2006.0,mandriva-2007.0,mandriva-2007.1,mandriva-2008.0,mandriva-2008.1,redhat-7.3,redhat-9,rhel-3,rhel-4,rhel-5,sles-10,sles-9,suse-10.0,suse-10.1,suse-10.2,suse-10.3,ubuntu-6.06,ubuntu-7.04,ubuntu-7.10,ubuntu-8.04 |
| | 166 | No Build files found for gentoo-nover |
| | 167 | Creating buffer tar files compressed... OK |
| | 168 | Under /users/bruno/pb/projects/buffer/delivery/buffer-1.19.tar.gz |
| | 169 | }}} |
| | 170 | So far so good. We now have a new tar file which contains all the build files expanded for the various distribution supported (even if some of them are not ready yet e.g. .deb in our case). |
| | 171 | |
| | 172 | Go one step further: |
| | 173 | {{{ |
| | 174 | pb -p buffer build2pkg |
| | 175 | Project: buffer |
| | 176 | Action: build2pkg |
| | 177 | Packages: buffer |
| | 178 | Extracting build files... OK |
| | 179 | Building package with /users/bruno/pb/projects/buffer/build/SPECS/buffer.spec under /users/bruno/pb/projects/buffer/build... Executing(%prep): /bin/sh -e /users/bruno/pb/projects/buffer/build/tmp/rpm-tmp.85498 |
| | 180 | + umask 022 |
| | 181 | + cd /users/bruno/pb/projects/buffer/build/BUILD |
| | 182 | + '[' 1 -eq 1 ']' |
| | 183 | + '[' 1 -eq 1 ']' |
| | 184 | + '[' 1 -eq 1 ']' |
| | 185 | + cd /users/bruno/pb/projects/buffer/build/BUILD |
| | 186 | + rm -rf buffer-1.19 |
| | 187 | + /usr/bin/gzip -dc /users/bruno/pb/projects/buffer/build/SOURCES/buffer-1.19.tar.gz |
| | 188 | + tar -xf - |
| | 189 | + STATUS=0 |
| | 190 | + '[' 0 -ne 0 ']' |
| | 191 | + cd buffer-1.19 |
| | 192 | + exit 0 |
| | 193 | Executing(%build): /bin/sh -e /users/bruno/pb/projects/buffer/build/tmp/rpm-tmp.85498 |
| | 194 | + umask 022 |
| | 195 | + cd /users/bruno/pb/projects/buffer/build/BUILD |
| | 196 | + cd buffer-1.19 |
| | 197 | + '[' 1 -eq 1 ']' |
| | 198 | + '[' 1 -eq 1 ']' |
| | 199 | + make -j4 |
| | 200 | gcc -Wall -O6 -fomit-frame-pointer -c -o buffer.o buffer.c |
| | 201 | gcc -Wall -O6 -fomit-frame-pointer -c -o sem.o sem.c |
| | 202 | sem.c:108: attention : return type defaults to ‘int’ |
| | 203 | sem.c: In function ‘do_sem’: |
| | 204 | sem.c:120: attention : implicit declaration of function ‘getpid’ |
| | 205 | sem.c:124: attention : ‘return’ with no value, in function returning non-void |
| | 206 | buffer.c:133: erreur: conflicting types for ‘shmat’ |
| | 207 | /usr/include/sys/shm.h:58: erreur: previous declaration of ‘shmat’ was here |
| | 208 | buffer.c: In function ‘main’: |
| | 209 | buffer.c:274: attention : implicit declaration of function ‘exit’ |
| | 210 | buffer.c:274: attention : incompatible implicit declaration of built-in function ‘exit’ |
| | 211 | buffer.c: In function ‘parse_args’: |
| | 212 | buffer.c:297: attention : implicit declaration of function ‘atoi’ |
| | 213 | buffer.c: In function ‘buffer_allocate’: |
| | 214 | buffer.c:515: attention : format ‘%08x’ expects type ‘unsigned int’, but argument 4 has type ‘char *’ |
| | 215 | buffer.c:520: attention : implicit declaration of function ‘bzero’ |
| | 216 | buffer.c:520: attention : incompatible implicit declaration of built-in function ‘bzero’ |
| | 217 | buffer.c: In function ‘fill_block’: |
| | 218 | buffer.c:695: attention : incompatible implicit declaration of built-in function ‘bzero’ |
| | 219 | buffer.c: In function ‘byee’: |
| | 220 | buffer.c:874: attention : incompatible implicit declaration of built-in function ‘exit’ |
| | 221 | buffer.c:878: attention : incompatible implicit declaration of built-in function ‘exit’ |
| | 222 | make: *** [buffer.o] Erreur 1 |
| | 223 | make: *** Attente des tâches non terminées.... |
| | 224 | error: Bad exit status from /users/bruno/pb/projects/buffer/build/tmp/rpm-tmp.85498 (%build) |
| | 225 | |
| | 226 | |
| | 227 | RPM build errors: |
| | 228 | Bad exit status from /users/bruno/pb/projects/buffer/build/tmp/rpm-tmp.85498 (%build) |
| | 229 | child (rpmbuild --define 'packager Bruno Cornec <bruno@project-builder.org>' --define "_topdir /users/bruno/pb/projects/buffer/build" -ba /users/bruno/pb/projects/buffer/build/SPECS/buffer.spec) exited with value 1 |
| | 230 | Checking validity of rpms with rpmlint... Error: no installed packages by name RPMS/*/buffer-1.19-1.mdv2008.1.*.rpm |
| | 231 | Error: no installed packages by name SRPMS/buffer-1.19-1.mdv2008.1.src.rpm |
| | 232 | OK |
| | 233 | }}} |
| | 234 | Ok, some patches seem to be required to be able to compile and link cleanly that application on my new shiny Mandriva 2008.1. |