git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Small script to patch .spec for Suse

From
Junio C Hamano <junkio@cox.net>
Date
Nov 15, 2005, 18:50 UTC
Message-ID
<7vfypxlp8k.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200511151230.30030.Josef.Weidendorfer@gmx.de>
Josef Weidendorfer <Josef.Weidendorfer@gmx.de> writes:
Show 5 quoted lines
> Everytime I update and want to generate RPM packages for
> my Suse distribution, I have to patch the git-core.spec.in
> Here is the current script for patching. It is only about
> package names, so a seperate .spec file would
> be overkill and a maintenance problem for me.

I've applied the patch from HPA to update it to git.spec already in my tree, so your script would not work any more ;-)

But seriously, I suspect we should take a hint from the fact that "git.spec.in" has ".in" in its name already.

Right now, git.spec is generated with this:
    git.spec: git.spec.in Makefile
            sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@
So presumably you could do something like this:
    --- git.spec.in
    +++ git.spec.in
    @@ -9,3 +9,3 @@
     Source:        http://kernel.org/pub/software/scm/git/%{name}-%{...
    -BuildRequires: zlib-devel >= 1.2, openssl-devel, curl-devel, exp...
    +BuildRequires: @@BUILD_REQUIRES@@
     BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(...
    @@ -26,3 +26,3 @@
     Group:         Development/Tools
    -Requires:      zlib >= 1.2, rsync, rcs, curl, less, openssh-clie...
    +Requires:      @@CORE_REQUIRES@@
     %description core
    @@ -40,3 +40,3 @@
     Group:          Development/Tools
    -Requires:       git-core = %{version}-%{release}, subversion
    +Requires:       git-core = %{version}-%{release}, @@SVN_REQUIRES@@
     %description svn
    @@ -47,3 +47,3 @@
     Group:          Development/Tools
    -Requires:       git-core = %{version}-%{release}, cvs, cvsps
    +Requires:       git-core = %{version}-%{release}, @@CVS_REQUIRES@@
    ...

and have something like this in the Makefile when you munge git.spec.in to produce git.spec for use with rpmbuild?

    RPM_BUILD_REQUIRES = zlib-devel >= 1.2 openssl-devel ...
    RPM_CORE_REQUIRES = zlib >= 1.2 rsync rcs curl less ...
    ifdef SUSE
    include suse.rpm.defs
    endif
    git.spec: git.spec.in Makefile
            sed \
                -e 's/@@VERSION@@/$(GIT_VERSION)/g' \
                -e 's/@@BUILD_REQUIRES@@/$(RPM_BUILD_REQUIRES)/g' \
                -e 's/@@CORE_REQUIRES@@/$(RPM_CORE_REQUIRES)/g' \
                -e 's/@@SVN_REQUIRES@@/$(RPM_SVN_REQUIRES)/g' \
                -e 's/@@CVS_REQUIRES@@/$(RPM_CVS_REQUIRES)/g' \
                -e 's/@@TLA_REQUIRES@@/$(RPM_TLA_REQUIRES)/g' \
                -e 's/@@EMAIL_REQUIRES@@/$(RPM_EMAIL_REQUIRES)/g' \
                -e 's/@@GITK_REQUIRES@@/$(RPM_GITK_REQUIRES)/g' \
	        <$< >$@
Previous: Josef WeidendorferNext: H. Peter Anvin
Message 2 of 11 in “Small script to patch .spec for Suse”
  1. Small script to patch .spec for SuseJosef Weidendorfer, Nov 15, 2005
  2. Junio C HamanoNov 15, 2005
  3. H. Peter AnvinNov 15, 2005
  4. Junio C HamanoNov 15, 2005
  5. Andreas EricssonNov 15, 2005
  6. Petr BaudisNov 15, 2005
  7. H. Peter AnvinNov 15, 2005
  8. Josef WeidendorferNov 16, 2005
  9. H. Peter AnvinNov 18, 2005
  10. A Large Angry SCMNov 18, 2005
  11. H. Peter AnvinNov 18, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.