(no commit message)
[openafs-wiki.git] / HowToBuildOpenAfsRpmPackages.mdwn
index 66409a3..938f45d 100644 (file)
@@ -1,46 +1,52 @@
-## Building RPM packages
-A script called makesrpm.pl is provided to build a source RPM package.  You can
-use the generated source RPM to build the binaries and create the RPM packages
-for your source code tree of OpenAFS.
-
-The first step is to create a source tree of OpenAFS. Run the regen.sh script
-to build the docs and to generate the configure script. Also, use git describe
-to make a version stamp file which will be used by the packaging process. This
-example shows how to get a source tree from a remote git repo.
-
-    $ git clone git://git.openafs.org/openafs.git openafs-<version>
-    $ cd openafs-<version>
-    $ git checkout <tagname>
-    $ git describe >.version
-    $ ./regen.sh
+# Building RPM packages for OpenAFS
 
-The _version_ is the dotted OpenAFS version number, such as 1.6.0,
-and the _tagname_ is the git tag for the version, such as openafs-stable-1_6_0.
-The _version_ number for pre-releases are suffixed with pre<number>. For example,
-to build 1.6.0pre5, create a directory called openafs-1.6.0pre5.
-[GPS Tracking](http://vamostech.com/gps-tracking), [Alamat Hipnoterapi Surabaya](http://subconscious-therapy.com/hipnoterapi-surabaya), [Harga Vertical Blind](http://www.tiraimodern.com/product/vertical-blind), [Properti Semarang](http://www.raywhitesemarang.com)
+The OpenAFS source tree contains an RPM spec file for building RPM packages.
+Recent versions of OpenAFS have makefile targets to build the source
+distribution tarballs and a source RPM package (srpm). After creating these
+files, run the `rpmbuild` tool to create create the binary RPM packages.
 
-Next, create a source RPM file. This requires creating a tar file for the
-source files and a tar file for the documents.  Run the makesrpm program
-to generate an OpenAFS source RPM.
+The following commands show how to build RPM packages from a git checkout.  The
+tools will create RPM packages from annotated git tags. Checkout a tag for the
+desired version, then generated the source rpm, then run rpmbuild to build the
+binaries RPM package files.
 
-    $ cd .. # move out of the source tree
-    $ tar cjf openafs-<version>-src.tar.bz2 openafs-<version> --exclude .git --exclude doc
-    $ tar cjf openafs-<version>-doc.tar.bz2 openafs-<version>/doc
-    $ openafs-<version>/src/packaging/RedHat/makesrpm.pl openafs-<version>-src.tar.bz2 openafs-<version>-doc.tar.bz2
+    $ git clone git://git.openafs.org/openafs.git
+    $ cd openafs
+    $ git checkout openafs-stable-<version>
+    $ ./regen.sh
+    $ ./configure
+    $ make dist     # not make dest !
+    $ make sprm     #?? not "make srpm" ???
+    $ rpmbuild --rebuild -ba --define "_topdir $(pwd)/rpmbuild" packages/openafs-<version>-1.src.rpm
 
-At this point you should have a source RPM called `openafs-<version>-1.0.src.rpm`. See the makesrpm.pl for additional options.
-The source tree and tar files are no longer needed.
+The packages will be created in the `rpmbuild/RPMS` directory.  See the RPM
+spec file in src/packaging/RedHat for the OpenAFS `--define` options.
 
-Finally, run rpmbuild to build the build binary RPM packages. If all goes well, the final
-output will show the destination directory and an exit code of zero.
+Comment: "make srpm" says: 
 
-    $ rpmbuild --rebuild openafs-<version>-1.0.src.rpm
+    $ make srpm
+    (cd packages && ../src/packaging/RedHat/makesrpm.pl *-src.tar.bz2 *-doc.tar.bz2)
+    tar: Pattern matching characters used in file names
+    tar: Use --wildcards to enable pattern matching, or --no-wildcards to suppress this warning
+    tar: */configure.ac: Not found in archive
     ...
-    + cd /usr/src/redhat/BUILD
-    + rm -rf openafs-<version>
-    + exit 0
-
-Alternatively, the source RPM may be installed, which will place the sources in the
-rpm SOURCE directory and a spec file in the rpm SPEC directory.
+    tar: Exiting with failure status due to previous errors
+    Unable to unpack src tar ball
+
+Using non-* names doesn't help:
+
+    $ (cd packages; ../src/packaging/RedHat/makesrpm.pl openafs-1.6.11pre1-15-g8f482-src.tar.bz2 openafs-1.6.11pre1-15-g8f482-doc.tar.bz2)
+    tar: Pattern matching characters used in file names
+    tar: Use --wildcards to enable pattern matching, or --no-wildcards to suppress this warning
+    tar: */configure.ac: Not found in archive
+    tar: Pattern matching characters used in file names
+    tar: Use --wildcards to enable pattern matching, or --no-wildcards to suppress this warning
+    tar: */src/packaging/RedHat: Not found in archive
+    tar: Pattern matching characters used in file names
+    tar: Use --wildcards to enable pattern matching, or --no-wildcards to suppress this warning
+    tar: */.version: Not found in archive
+    tar: Pattern matching characters used in file names
+    tar: Use --wildcards to enable pattern matching, or --no-wildcards to suppress this warning
+    tar: */build-tools: Not found in archive
+    tar: Exiting with failure status due to previous errors
+    Unable to unpack src tar ball