Re: [PATCH 0/3] cogito spec file updates

4 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 0/3] cogito spec file updates

From: Petr Baudis <hidden>
Date: 2016-06-15 22:41:56

Dear diary, on Tue, May 03, 2005 at 11:32:16PM CEST, I got a letter
where Chris Wright [off-list ref] told me that...
* Petr Baudis (pasky@ucw.cz) wrote:
quoted
I might however have some private mkrelease.sh script which would do

	echo "$1" >VERSION
	update-spec-file
	echo "$1" | cg-commit
	cg-tag "$1"

or something.
If you had a Makefile target like the one Mark Allen just posted, would
you use that?
No, I definitively won't use that:

(i)  The created tarball is Evil. It does not contain everything in a
subdirectory.

(ii) I don't want to have yet another place which I'm supposed to keep
up to date with regard to what should be packaged. That's one of the
things the SCM is for, and it already records precisely this
information, so I'd actually use it. cg-export foo.tar.gz is the perfect
tool for this.
I'd simply add a git.spec: rule, and have git.spec built
as a dependency for tarball.
I wouldn't accept this neither. If git.spec is already version
controlled, it should be up-to-date in the version control. Therefore,
you need to update it at the time of release, not at the time of
generating the tarball.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor

Re: [PATCH 0/3] cogito spec file updates

From: Chris Wright <hidden>
Date: 2016-06-15 22:41:56

* Petr Baudis (pasky@ucw.cz) wrote:
I wouldn't accept this neither. If git.spec is already version
controlled, it should be up-to-date in the version control. Therefore,
you need to update it at the time of release, not at the time of
generating the tarball.
*shrug*

Well, it's guaranteed to be one step out of sync, but I'll just keep
doing what I've been doing.  Build rpm after you release, and send
patch ex-post-facto.

thanks,
-chris

Re: [PATCH 0/3] cogito spec file updates

From: "H. Peter Anvin" <hpa@zytor.com>
Date: 2016-06-15 22:41:56

Petr Baudis wrote:
I wouldn't accept this neither. If git.spec is already version
controlled, it should be up-to-date in the version control. Therefore,
you need to update it at the time of release, not at the time of
generating the tarball.
What I usually do is to have a *.spec.in file, and have my release 
script generate the *.spec file.  I usually have a "version" file 
checked into the SCM from which all version information derives, 
including what to put in the *.spec file as well as what to name the 
subdirectory.

The release script then ends up being some variant on:

#!/bin/sh -xe
PACKAGE=pkgname
VERSION=`cat version`
scm-of-choice tag --force $PACKAGE-$VERSION
mkdir /var/tmp/$PACKAGE-$VERSION
cd /var/tmp/$PACKAGE-$VERSION
scm-of-choice export -r $PACKAGE-$VERSION
make release
cd ..
tar cvvfz $PACKAGE-$VERSION.tar.gz $PACKAGE-$VERSION
rm -rf $PACKAGE-$VERSION

... where "make release" creates the specfile and anything else that 
needs to be created (like autoconf files.)

	-hpa

Re: [PATCH 0/3] cogito spec file updates

From: Chris Wright <hidden>
Date: 2016-06-15 22:41:56

* H. Peter Anvin (hpa@zytor.com) wrote:
What I usually do is to have a *.spec.in file, and have my release 
script generate the *.spec file.  I usually have a "version" file 
checked into the SCM from which all version information derives, 
including what to put in the *.spec file as well as what to name the 
subdirectory.

The release script then ends up being some variant on:

#!/bin/sh -xe
PACKAGE=pkgname
VERSION=`cat version`
scm-of-choice tag --force $PACKAGE-$VERSION
mkdir /var/tmp/$PACKAGE-$VERSION
cd /var/tmp/$PACKAGE-$VERSION
scm-of-choice export -r $PACKAGE-$VERSION
make release
cd ..
tar cvvfz $PACKAGE-$VERSION.tar.gz $PACKAGE-$VERSION
rm -rf $PACKAGE-$VERSION

... where "make release" creates the specfile and anything else that 
needs to be created (like autoconf files.)
Yup, that's precisely what I was thinking.  I cobbled up an add-on to
Mark Allen's patch yesterday, but didn't send it since Pasky didn't seem
too interested in the idea.  Anyway, here it is to demonstrate the idea.
The current setup is definitely workable, just means each release tarball
will build a bogus package with rpmbuild -ta.  So I just fix up the spec
and then build...

thanks,
-chris
--



Autogen git.spec from git.spec.in.  Needs patch from Mark Allen.

Signed-off-by: Chris Wright <redacted>
--- cogito/Makefile~orig	2005-05-03 14:41:50.000000000 -0700
+++ cogito/Makefile	2005-05-03 15:53:36.000000000 -0700
@@ -126,6 +126,8 @@
 	@chmod +x $@
 endif
 
+git.spec: git.spec.in $(VERSION) 
+	sed -e 's/@@VERSION@@/$(shell cat $(VERSION) | cut -d"-" -f2)/g' < $< > $@
 
 install: $(PROG) $(SCRIPTS) $(SCRIPT) $(GEN_SCRIPT)
 	install -m755 -d $(DESTDIR)$(bindir)
@@ -141,10 +143,10 @@
 backup: clean
 	cd .. ; tar czvf dircache.tar.gz dir-cache
 
-release-tar-gzip: clean
+release-tar-gzip: clean git.spec
 	tar czf $(shell cat $(VERSION)).tar.gz *.c *.h git.spec Makefile $(DOCS) $(DIRS) $(SCRIPTS) $(SCRIPT) 
 
-release-tar-bzip2: clean
+release-tar-bzip2: clean git.spec
 	tar cjf $(shell cat $(VERSION)).tar.bz2 *.c *.h git.spec Makefile $(DOCS) $(DIRS) $(SCRIPTS) $(SCRIPT) 
 
 release-tarballs: release-tar-gzip release-tar-bzip2
--- cogito/git.spec~orig	2005-05-03 14:41:59.000000000 -0700
+++ cogito/git.spec	2005-05-03 14:42:55.000000000 -0700
@@ -1,55 +0,0 @@
-Name: 		cogito
-Version: 	0.8
-Release: 	2
-Vendor: 	Petr Baudis <pasky@ucw.cz>
-Summary:  	Git core and tools
-License: 	GPL
-Group: 		Development/Tools
-URL: 		http://kernel.org/pub/software/scm/cogito/
-Source: 	http://kernel.org/pub/software/scm/cogito/%{name}-%{version}.tar.bz2
-Provides: 	cogito = %{version}
-Obsoletes:	git
-BuildRequires:	zlib-devel, openssl-devel, curl-devel
-BuildRoot:	%{_tmppath}/%{name}-%{version}-root
-Prereq: 	sh-utils, diffutils, rsync, rcs, mktemp >= 1.5
-
-%description
-GIT comes in two layers. The bottom layer is merely an extremely fast
-and flexible filesystem-based database designed to store directory trees
-with regard to their history. The top layer is a SCM-like tool which
-enables human beings to work with the database in a manner to a degree
-similar to other SCM tools (like CVS, BitKeeper or Monotone).
-
-%prep
-%setup -q
-
-%build
-
-make
-
-%install
-rm -rf $RPM_BUILD_ROOT
-make DESTDIR=$RPM_BUILD_ROOT prefix=%{_prefix} install
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%files
-%defattr(-,root,root)
-/usr/bin/*
-%doc README README.reference COPYING Changelog
-
-%changelog
-* Wed Apr 27 2005 Terje Rosten <terje.rosten@ntnu.no> 0.8-2
-- Doc files
-- Use %%{_prefix} macro
-- Drop -n option to %%setup macro
-
-* Mon Apr 25 2005 Chris Wright <chrisw@osdl.org> 0.8-1
-- Update to cogito, rename package, move to /usr/bin, update prereqs
-
-* Mon Apr 25 2005 Chris Wright <chrisw@osdl.org> 0.7-1
-- Update to 0.7
-
-* Thu Apr 21 2005 Chris Wright <chrisw@osdl.org> 0.6.3-1
-- Initial rpm build
--- cogito/git.spec.in~orig	2005-05-03 14:42:20.000000000 -0700
+++ cogito/git.spec.in	2005-05-03 14:44:19.000000000 -0700
@@ -0,0 +1,58 @@
+Name: 		cogito
+Version: 	@@VERSION@@
+Release: 	1
+Vendor: 	Petr Baudis <pasky@ucw.cz>
+Summary:  	Git core and tools
+License: 	GPL
+Group: 		Development/Tools
+URL: 		http://kernel.org/pub/software/scm/cogito/
+Source: 	http://kernel.org/pub/software/scm/cogito/%{name}-%{version}.tar.bz2
+Provides: 	cogito = %{version}
+Obsoletes:	git
+BuildRequires:	zlib-devel, openssl-devel, curl-devel
+BuildRoot:	%{_tmppath}/%{name}-%{version}-root
+Prereq: 	sh-utils, diffutils, rsync, rcs, mktemp >= 1.5
+
+%description
+GIT comes in two layers. The bottom layer is merely an extremely fast
+and flexible filesystem-based database designed to store directory trees
+with regard to their history. The top layer is a SCM-like tool which
+enables human beings to work with the database in a manner to a degree
+similar to other SCM tools (like CVS, BitKeeper or Monotone).
+
+%prep
+%setup -q
+
+%build
+
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT prefix=%{_prefix} install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+/usr/bin/*
+%doc README README.reference COPYING Changelog
+
+%changelog
+* Tue May 3 2005 Chris Wright <chrisw@osdl.org>
+- Auto build from git.spec.in
+
+* Wed Apr 27 2005 Terje Rosten <terje.rosten@ntnu.no> 0.8-2
+- Doc files
+- Use %%{_prefix} macro
+- Drop -n option to %%setup macro
+
+* Mon Apr 25 2005 Chris Wright <chrisw@osdl.org> 0.8-1
+- Update to cogito, rename package, move to /usr/bin, update prereqs
+
+* Mon Apr 25 2005 Chris Wright <chrisw@osdl.org> 0.7-1
+- Update to 0.7
+
+* Thu Apr 21 2005 Chris Wright <chrisw@osdl.org> 0.6.3-1
+- Initial rpm build
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help