| OLD | NEW |
| 1 #!/bin/sh -e | 1 #!/bin/sh -e |
| 2 | 2 |
| 3 # Run this from the 'packages' directory, just under rootdir | 3 # Run this from the 'packages' directory, just under rootdir |
| 4 | 4 |
| 5 # We can only build rpm packages, if the rpm build tools are installed | 5 # We can only build rpm packages, if the rpm build tools are installed |
| 6 if [ \! -x /usr/bin/rpmbuild ] | 6 if [ \! -x /usr/bin/rpmbuild ] |
| 7 then | 7 then |
| 8 echo "Cannot find /usr/bin/rpmbuild. Not building an rpm." 1>&2 | 8 echo "Cannot find /usr/bin/rpmbuild. Not building an rpm." 1>&2 |
| 9 exit 0 | 9 exit 0 |
| 10 fi | 10 fi |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 mkdir "$RPM_SOURCE_DIR" | 45 mkdir "$RPM_SOURCE_DIR" |
| 46 mkdir "$RPM_BUILD_DIR" | 46 mkdir "$RPM_BUILD_DIR" |
| 47 | 47 |
| 48 cp "$archive" "$RPM_SOURCE_DIR" | 48 cp "$archive" "$RPM_SOURCE_DIR" |
| 49 | 49 |
| 50 # rpmbuild -- as far as I can tell -- asks the OS what CPU it has. | 50 # rpmbuild -- as far as I can tell -- asks the OS what CPU it has. |
| 51 # This may differ from what kind of binaries gcc produces. dpkg | 51 # This may differ from what kind of binaries gcc produces. dpkg |
| 52 # does a better job of this, so if we can run 'dpkg --print-architecture' | 52 # does a better job of this, so if we can run 'dpkg --print-architecture' |
| 53 # to get the build CPU, we use that in preference of the rpmbuild | 53 # to get the build CPU, we use that in preference of the rpmbuild |
| 54 # default. | 54 # default. |
| 55 target=`dpkg --print-architecture 2>/dev/null` # "" if dpkg isn't found | 55 target=`dpkg --print-architecture 2>/dev/null || echo ""` |
| 56 if [ -n "$target" ] | 56 if [ -n "$target" ] |
| 57 then | 57 then |
| 58 target=" --target $target" | 58 target=" --target $target" |
| 59 fi | 59 fi |
| 60 | 60 |
| 61 rpmbuild -bb rpm/rpm.spec $target \ | 61 rpmbuild -bb rpm/rpm.spec $target \ |
| 62 --define "NAME $PACKAGE" \ | 62 --define "NAME $PACKAGE" \ |
| 63 --define "VERSION $VERSION" \ | 63 --define "VERSION $VERSION" \ |
| 64 --define "_sourcedir $RPM_SOURCE_DIR" \ | 64 --define "_sourcedir $RPM_SOURCE_DIR" \ |
| 65 --define "_builddir $RPM_BUILD_DIR" \ | 65 --define "_builddir $RPM_BUILD_DIR" \ |
| (...skipping 11 matching lines...) Expand all Loading... |
| 77 grep "Fedora Core.*release 3" /etc/issue >/dev/null 2>&1 && destdir=fc3 | 77 grep "Fedora Core.*release 3" /etc/issue >/dev/null 2>&1 && destdir=fc3 |
| 78 fi | 78 fi |
| 79 | 79 |
| 80 rm -rf "$destdir" | 80 rm -rf "$destdir" |
| 81 mkdir -p "$destdir" | 81 mkdir -p "$destdir" |
| 82 # We want to get not only the main package but devel etc, hence the middle * | 82 # We want to get not only the main package but devel etc, hence the middle * |
| 83 mv "$RPM_SOURCE_DIR"/*/"${PACKAGE}"-*"${VERSION}"*.rpm "$destdir" | 83 mv "$RPM_SOURCE_DIR"/*/"${PACKAGE}"-*"${VERSION}"*.rpm "$destdir" |
| 84 | 84 |
| 85 echo | 85 echo |
| 86 echo "The rpm package file(s) are located in $PWD/$destdir" | 86 echo "The rpm package file(s) are located in $PWD/$destdir" |
| OLD | NEW |