Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make rpm on old distros? #1389

Closed
schlomo opened this issue Jun 21, 2017 · 10 comments
Closed

How to make rpm on old distros? #1389

schlomo opened this issue Jun 21, 2017 · 10 comments

Comments

@schlomo
Copy link
Member

schlomo commented Jun 21, 2017

Trying to make rpm on SLES 10 SP3 ☹. Managed to install git 1.9.3 from some OBS repo (thanks @jsmeix !) but make rpm fails like this:

rearsles10sp3:~/rear # make rpm
rm -fv rear-2.1*.tar.gz rear-2.1*.rpm
removed `rear-2.1-git201706191551.tar.gz'
removed `rear-2.1-1.git201706191551.x86_64.rpm'
rm -f build-stamp
make -C doc clean
make[1]: Entering directory `/root/rear/doc'
rm -f unconv.8 *.html *.xml
make -C user-guide clean
make[2]: Entering directory `/root/rear/doc/user-guide'
rm -f *.html *.svg *.xml
make[2]: Leaving directory `/root/rear/doc/user-guide'
make[1]: Leaving directory `/root/rear/doc'
== Validating scripts and configuration ==
find etc/ usr/share/rear/conf/ -name '*.conf' | xargs -n 1 bash -n
bash -n usr/sbin/rear
find . -name '*.sh' | xargs -n 1 bash -n
find usr/share/rear -name '*.sh' | grep -v -E '(lib|skel|conf)' | while read FILE ; do \
	num=$(echo ${FILE##*/} | cut -c1-3); \
	if [[ "$num" = "000" || "$num" = "999" ]] ; then \
		echo "ERROR: script $FILE may not start with $num"; \
		exit 1; \
	else \
		if $( grep '[_[:alpha:]]' <<< $num >/dev/null 2>&1 ) ; then \
			echo "ERROR: script $FILE must start with 3 digits"; \
			exit 1; \
		fi; \
	fi; \
done
== Prepare manual ==
make -C doc man
make[1]: Entering directory `/root/rear/doc'
make[1]: Nothing to be done for `man'.
make[1]: Leaving directory `/root/rear/doc'
== Rewriting packaging/rpm/rear.spec, packaging/debian/rear.dsc and usr/sbin/rear ==
sed -i.orig \
	-e 's#^Source:.*#Source: https://sourceforge.net/projects/rear/files/rear/2.1/rear-2.1-git201706200937.tar.gz#' \
	-e 's#^Version:.*#Version: 2.1#' \
	-e 's#^%define rpmrelease.*#%define rpmrelease .git201706200937#' \
	-e 's#^%setup.*#%setup -q -n rear-2.1-git201706200937#' \
	packaging/rpm/rear.spec
sed -i.orig \
	-e 's#^Version:.*#Version: 2.1-0git201706200937#' \
	packaging/debian/rear.dsc
sed -i.orig \
	-e 's#^readonly VERSION=.*#readonly VERSION=2.1-git201706200937#' \
	-e 's#^readonly RELEASE_DATE=.*#readonly RELEASE_DATE="2017-06-20"#' \
	usr/sbin/rear
== Building archive rear-2.1-git201706200937 ==
git checkout 
M	packaging/debian/rear.dsc
M	packaging/rpm/rear.spec
M	usr/sbin/rear
Your branch is up-to-date with 'origin/schlomo-2017-06'.
git ls-tree -r --name-only --full-tree  | \
	tar -czf rear-2.1-git201706200937.tar.gz --transform='s,^,rear-2.1-git201706200937/,S' --files-from=-
usage: git ls-tree [<options>] <tree-ish> [<path>...]

    -d                    only show trees
    -r                    recurse into subtrees
    -t                    show trees when recursing
    -z                    terminate entries with NUL byte
    -l, --long            include object size
    --name-only           list only filenames
    --name-status         list only filenames
    --full-name           use full path names
    --full-tree           list entire tree; not just current directory (implies --full-name)
    --abbrev[=<n>]        use <n> digits to display SHA-1s

tar: unrecognized option `--transform=s,^,rear-2.1-git201706200937/,S'
Try `tar --help' or `tar --usage' for more information.
make: *** [rear-2.1-git201706200937.tar.gz] Error 64

Any ideas?

@jsmeix
Copy link
Member

jsmeix commented Jun 21, 2017

In a git checkout I get:

$ find . | xargs grep 'transform'

./Makefile:             tar -czf $(name)-$(distversion).tar.gz --transform='s,^,$(name)-$(distversion)/,S' --files-from=-

It seems tar in SLE10 is too old for the the '--transform' option
that is used in the Makefile because on my SLES10-SP4 system
"man tar" does not mention the '--transform' option while
it is mentioned in "man tar" on my SLES11 system.

According to the output of

git log -p --follow Makefile

the '--transform' option was introduced in Jun 2012 via
e16dcd2

@gdha
Copy link
Member

gdha commented Jun 21, 2017

@schlomo @jsmeix Albeit that within OBS the rpms are properly build for SLES10. Reverting the change? Remember SLES 10 is not on our support list anymore, but nobody prevents you to adapt the Makefile for your needs locally.

@schlomo
Copy link
Member Author

schlomo commented Jun 21, 2017

I think that I really would like to see a make srpm option which I can use on my laptop and then build the rpm on the target distro.

Source → Source Package → Binary Package

@jsmeix
Copy link
Member

jsmeix commented Jun 21, 2017

@gdha
I think building RPMs within the openSUSE Build Service
happens via rear.spec which does not call 'make rpm'
but only 'make install' as far as I see on first glance in rear.spec
https://build.opensuse.org/package/view_file/Archiving:Backup:Rear/rear-2.1/rear.spec?expand=1
and in the build log for SLE10
https://build.opensuse.org/package/live_build_log/Archiving:Backup:Rear/rear-2.1/SLE_10_SDK/i586

@schlomo
Copy link
Member Author

schlomo commented Jun 21, 2017

OBS works because it just does rpmbuild -ba on SLES10. You feed it a ready-made source tar.gz so that the problematic part is already done.

@gdha
Copy link
Member

gdha commented Jun 21, 2017

@jsmeix thanks for pointing this out - I was not aware (anymore) of how it was build.

@gdha
Copy link
Member

gdha commented Jun 22, 2017

@schlomo @jsmeix Would reverting back to using pax bring new issues? Or, would make srpm be a better solution in the end?

@schlomo
Copy link
Member Author

schlomo commented Jun 22, 2017

I'd like to see a make srpm step, that can use all the modern stuff. The make rpm should be based on make srpm.

gdha added a commit that referenced this issue Jun 22, 2017
…ckage first.

This src.rpm package can then be easily copied to another computer to rebuild a rpm package from it without needed the sources itself (or git checkout).
Concerns issue #1389 - verification still required on OBS to see the nightly builds are performed as usual
@gdha
Copy link
Member

gdha commented Jun 22, 2017

@schlomo Whenever you have time please verify the update of the Makefile

gdha added a commit that referenced this issue Jun 22, 2017
schlomo pushed a commit that referenced this issue Jun 22, 2017
…ckage first.

This src.rpm package can then be easily copied to another computer to rebuild a rpm package from it without needed the sources itself (or git checkout).
Concerns issue #1389 - verification still required on OBS to see the nightly builds are performed as usual
schlomo pushed a commit that referenced this issue Jun 22, 2017
@schlomo
Copy link
Member Author

schlomo commented Jun 22, 2017

It works - thanks a lot. Unfortunately with sles10 I had to do rpmbuild from the tar.gz. Sorry for bothering you (although I do think it is cleaner now). Let's work on the development build naming in #1362

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants