git/git.spec

changeset 516
827ba617ed8c
child 517
11b64eba18d7
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/git/git.spec	Fri Aug 10 14:40:03 2012 +0200
     1.3 @@ -0,0 +1,359 @@
     1.4 +##
     1.5 +##  git.spec -- OpenPKG RPM Package Specification
     1.6 +##  Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
     1.7 +##
     1.8 +##  Permission to use, copy, modify, and distribute this software for
     1.9 +##  any purpose with or without fee is hereby granted, provided that
    1.10 +##  the above copyright notice and this permission notice appear in all
    1.11 +##  copies.
    1.12 +##
    1.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    1.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    1.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    1.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    1.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    1.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    1.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.24 +##  SUCH DAMAGE.
    1.25 +##
    1.26 +
    1.27 +#   package version
    1.28 +%define       V_git       1.7.11.4
    1.29 +%define       V_cogito    0.18.2
    1.30 +%define       V_stgit     0.14.3
    1.31 +%define       V_guilt     0.35
    1.32 +%define       V_tig       1.0
    1.33 +%define       V_gcutils   0.2.3
    1.34 +
    1.35 +#   package information
    1.36 +Name:         git
    1.37 +Summary:      Distributed Version Control System
    1.38 +URL:          http://git-scm.com/
    1.39 +Vendor:       Linus Torvalds, Junio C Hamano
    1.40 +Packager:     OpenPKG Foundation e.V.
    1.41 +Distribution: OpenPKG Community
    1.42 +Class:        EVAL
    1.43 +Group:        SCM
    1.44 +License:      GPL
    1.45 +Version:      %{V_git}
    1.46 +Release:      20120731
    1.47 +
    1.48 +#   package options
    1.49 +%option       with_doc     no
    1.50 +%option       with_cogito  no
    1.51 +%option       with_stgit   no
    1.52 +%option       with_guilt   no
    1.53 +%option       with_tig     no
    1.54 +%option       with_gcutils no
    1.55 +%option       with_svn     no
    1.56 +
    1.57 +#   list of sources
    1.58 +Source0:      http://git-core.googlecode.com/files/git-%{V_git}.tar.gz
    1.59 +Source1:      http://www.kernel.org/pub/software/scm/cogito/cogito-%{V_cogito}.tar.gz
    1.60 +Source2:      http://homepage.ntlworld.com/cmarinas/stgit/stgit-%{V_stgit}.tar.gz
    1.61 +Source3:      http://www.kernel.org/pub/linux/kernel/people/jsipek/guilt/guilt-%{V_guilt}.tar.gz
    1.62 +Source4:      http://jonas.nitro.dk/tig/releases/tig-%{V_tig}.tar.gz
    1.63 +Source5:      http://switch.dl.sourceforge.net/gcutils/gcutils-v%{V_gcutils}.tar.gz
    1.64 +Source6:      rc.git
    1.65 +Source7:      git-notify
    1.66 +Patch0:       git.patch
    1.67 +
    1.68 +#   build information
    1.69 +BuildPreReq:  OpenPKG, openpkg >= 20100101
    1.70 +PreReq:       OpenPKG, openpkg >= 20100101
    1.71 +BuildPreReq:  gcc, make, perl-openpkg
    1.72 +%if "%{with_doc}" == "yes"
    1.73 +BuildPreReq:  asciidoc, xmlto
    1.74 +%endif
    1.75 +BuildPreReq:  bash, perl, diffutils
    1.76 +PreReq:       bash, perl, diffutils
    1.77 +BuildPreReq:  zlib, openssl, curl, expat, libiconv, pcre
    1.78 +PreReq:       zlib, openssl, curl, expat, libiconv, pcre
    1.79 +BuildPreReq:  python
    1.80 +PreReq:       python
    1.81 +%if "%{with_tig}" == "yes"
    1.82 +BuildPreReq:  ncurses
    1.83 +PreReq:       ncurses
    1.84 +%endif
    1.85 +%if "%{with_gcutils}" == "yes"
    1.86 +BuildPreReq:  gzip
    1.87 +%endif
    1.88 +%if "%{with_svn}" == "yes"
    1.89 +PreReq:       subversion-perl
    1.90 +%endif
    1.91 +
    1.92 +%description
    1.93 +    GIT is a "directory content manager" designed to handle absolutely
    1.94 +    massive projects with speed and efficiency. GIT falls in the
    1.95 +    category of distributed source code management tools. Every GIT
    1.96 +    working directory is a full-fledged repository with full revision
    1.97 +    tracking capabilities, not dependent on network access to a central
    1.98 +    server.
    1.99 +
   1.100 +    This package contains both the low-level GIT core components and
   1.101 +    optionally the high-level GIT frontends Cogito, StGIT and Guilt.
   1.102 +
   1.103 +%track
   1.104 +    prog git:git = {
   1.105 +        version   = %{V_git}
   1.106 +        url       = http://code.google.com/p/git-core/downloads/list
   1.107 +        regex     = git-(\d+(\.\d+)+)\.tar\.gz
   1.108 +    }
   1.109 +    prog git:cogito = {
   1.110 +        version   = %{V_cogito}
   1.111 +        url       = http://www.kernel.org/pub/software/scm/cogito/
   1.112 +        regex     = cogito-(__VER__)\.tar\.gz
   1.113 +    }
   1.114 +    prog git:stgit = {
   1.115 +        version   = %{V_stgit}
   1.116 +        url       = http://homepage.ntlworld.com/cmarinas/stgit/
   1.117 +        regex     = stgit-(__VER__)\.tar\.gz
   1.118 +    }
   1.119 +    prog git:guilt = {
   1.120 +        version   = %{V_guilt}
   1.121 +        url       = http://www.kernel.org/pub/linux/kernel/people/jsipek/guilt/
   1.122 +        regex     = guilt-(__VER__)\.tar\.gz
   1.123 +    }
   1.124 +    prog git:tig = {
   1.125 +        version   = %{V_tig}
   1.126 +        url       = http://jonas.nitro.dk/tig/releases/
   1.127 +        regex     = tig-(__VER__)\.tar\.gz
   1.128 +    }
   1.129 +    prog git:gcutils = {
   1.130 +        version   = %{V_gcutils}
   1.131 +        url       = http://sourceforge.net/projects/gcutils/files/
   1.132 +        regex     = gcutils-v(__VER__)\.tar\.gz
   1.133 +    }
   1.134 +
   1.135 +%prep
   1.136 +    %setup -q -c
   1.137 +    %setup -q -T -D -a 1
   1.138 +    %setup -q -T -D -a 2
   1.139 +    %setup -q -T -D -a 3
   1.140 +    %setup -q -T -D -a 4
   1.141 +    %setup -q -T -D -a 5
   1.142 +    %patch -p0
   1.143 +
   1.144 +%build
   1.145 +    #   build GIT core
   1.146 +    ( cd git-%{V_git}
   1.147 +      find . -name "*.[ch]" -print |\
   1.148 +      xargs %{l_shtool} subst \
   1.149 +          -e 's;struct option;struct git_option;g'
   1.150 +      ( echo "GITWEB_CONFIG         = %{l_prefix}/etc/git/gitweb.config.pl"
   1.151 +        echo "GITWEB_BASE_URL       = /openpkg-cgi/gitweb.d"
   1.152 +        echo "GITWEB_CSS            = /openpkg-cgi/gitweb.d/static/gitweb.css"
   1.153 +        echo "GITWEB_JS             = /openpkg-cgi/gitweb.d/static/gitweb.js"
   1.154 +        echo "GITWEB_LOGO           = /openpkg-cgi/gitweb.d/static/git-logo.png"
   1.155 +        echo "GITWEB_FAVICON        = /openpkg-cgi/gitweb.d/static/git-favicon.png"
   1.156 +        echo "GITWEB_PROJECTROOT    = %{l_prefix}/var/git"
   1.157 +        echo "PYTHON_PATH           = %{l_prefix}/bin/python"
   1.158 +        echo "NEEDS_CRYPTO_WITH_SSL = YesPlease"
   1.159 +      ) >config.mak
   1.160 +      ( echo "ac_cv_header_libintl_h=no"
   1.161 +      ) >config.cache
   1.162 +      CC="%{l_cc}" \
   1.163 +      CFLAGS="%{l_cflags -O}" \
   1.164 +      CPPFLAGS="%{l_cppflags}" \
   1.165 +      LDFLAGS="%{l_ldflags}" \
   1.166 +      LIBS="-lssl -lcrypto -lz" \
   1.167 +      ./configure \
   1.168 +          --cache-file=./config.cache \
   1.169 +          --prefix=%{l_prefix} \
   1.170 +          --mandir=%{l_prefix}/man \
   1.171 +          --with-gitconfig=%{l_prefix}/etc/git/gitconfig \
   1.172 +          --with-gitattributes=%{l_prefix}/etc/git/gitattributes \
   1.173 +          --with-openssl=%{l_prefix} \
   1.174 +          --with-libpcre=%{l_prefix} \
   1.175 +          --with-curl=%{l_prefix} \
   1.176 +          --with-expat=%{l_prefix} \
   1.177 +          --with-iconv=%{l_prefix} \
   1.178 +          --with-zlib=%{l_prefix} \
   1.179 +          --with-shell=%{l_prefix}/bin/bash \
   1.180 +          --with-perl=%{l_prefix}/bin/perl \
   1.181 +          --without-python \
   1.182 +          --without-tcltk \
   1.183 +          --disable-pthreads
   1.184 +      %{l_make} %{l_mflags}
   1.185 +%if "%{with_doc}" == "yes"
   1.186 +      ( cd Documentation
   1.187 +        %{l_make} %{l_mflags} man
   1.188 +      ) || exit $?
   1.189 +%endif
   1.190 +    ) || exit $?
   1.191 +
   1.192 +    #   build Cogito frontend
   1.193 +%if "%{with_cogito}" == "yes"
   1.194 +    ( cd cogito-%{V_cogito}
   1.195 +      %{l_make} %{l_mflags} \
   1.196 +          prefix=%{l_prefix}
   1.197 +    ) || exit $?
   1.198 +%endif
   1.199 +
   1.200 +    #   build Guilt add-on
   1.201 +%if "%{with_guilt}" == "yes"
   1.202 +    ( cd guilt-%{V_guilt}
   1.203 +      %{l_shtool} subst \
   1.204 +         -e 's;/bin/sh;%{l_prefix}/bin/bash;g' \
   1.205 +         guilt*
   1.206 +    ) || exit $?
   1.207 +%endif
   1.208 +
   1.209 +    #   build Tig add-on
   1.210 +%if "%{with_tig}" == "yes"
   1.211 +    ( cd tig-%{V_tig}
   1.212 +      CC="%{l_cc}" \
   1.213 +      CFLAGS="%{l_cflags -O}" \
   1.214 +      CPPFLAGS="%{l_cppflags ncurses .}" \
   1.215 +      LDFLAGS="%{l_ldflags}" \
   1.216 +      ./configure \
   1.217 +          --prefix=%{l_prefix} \
   1.218 +          --mandir=%{l_prefix}/man \
   1.219 +          --with-libiconv=%{l_prefix}
   1.220 +      %{l_make} %{l_mflags}
   1.221 +    ) || exit $?
   1.222 +%endif
   1.223 +
   1.224 +    #   build GC-Utils add-on
   1.225 +%if "%{with_gcutils}" == "yes"
   1.226 +    ( cd gc-utils
   1.227 +      %{l_make} %{l_mflags} \
   1.228 +          prefix=%{l_prefix} \
   1.229 +          mandir=%{l_prefix}/man
   1.230 +    ) || exit $?
   1.231 +%endif
   1.232 +
   1.233 +%install
   1.234 +    #   install GIT core
   1.235 +    ( cd git-%{V_git}
   1.236 +      %{l_make} %{l_mflags} install \
   1.237 +          DESTDIR=$RPM_BUILD_ROOT
   1.238 +%if "%{with_doc}" == "yes"
   1.239 +      ( cd Documentation
   1.240 +        %{l_shtool} mkdir -f -p -m 755 \
   1.241 +            $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
   1.242 +            $RPM_BUILD_ROOT%{l_prefix}/man/man5 \
   1.243 +            $RPM_BUILD_ROOT%{l_prefix}/man/man7
   1.244 +        %{l_shtool} install -c -m 644 \
   1.245 +            *.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
   1.246 +        %{l_shtool} install -c -m 644 \
   1.247 +            *.5 $RPM_BUILD_ROOT%{l_prefix}/man/man5/
   1.248 +        %{l_shtool} install -c -m 644 \
   1.249 +            *.7 $RPM_BUILD_ROOT%{l_prefix}/man/man7/
   1.250 +      ) || exit $?
   1.251 +%endif
   1.252 +%if "%{with_svn}" != "yes"
   1.253 +      rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/git/git-svn
   1.254 +%endif
   1.255 +    ) || exit $?
   1.256 +
   1.257 +    #   install git-notify(1) addon utility
   1.258 +    %{l_shtool} install -c -m 755 \
   1.259 +        -e 's;/usr/bin/perl;%{l_prefix}/bin/perl;' \
   1.260 +        %{SOURCE git-notify} \
   1.261 +        $RPM_BUILD_ROOT%{l_prefix}/bin/
   1.262 +
   1.263 +    #   install GIT web interface
   1.264 +    %{l_shtool} mkdir -f -p -m 755 \
   1.265 +        $RPM_BUILD_ROOT%{l_prefix}/cgi/gitweb.d/static \
   1.266 +        $RPM_BUILD_ROOT%{l_prefix}/etc/git
   1.267 +    %{l_shtool} install -c -m 755 \
   1.268 +        git-%{V_git}/gitweb/gitweb.cgi $RPM_BUILD_ROOT%{l_prefix}/cgi/
   1.269 +    %{l_shtool} install -c -m 644 \
   1.270 +        git-%{V_git}/gitweb/static/* \
   1.271 +        $RPM_BUILD_ROOT%{l_prefix}/cgi/gitweb.d/static/
   1.272 +    (   echo "##"
   1.273 +        echo "##  gitweb.config.pl -- gitweb Perl configuration "
   1.274 +        echo "##"
   1.275 +        echo ""
   1.276 +        echo "1;"
   1.277 +    ) >gitweb.config.pl
   1.278 +    %{l_shtool} install -c -m 755 \
   1.279 +        gitweb.config.pl $RPM_BUILD_ROOT%{l_prefix}/etc/git/
   1.280 +
   1.281 +    #   provide HTTP backend CGI under canonical path for Apache
   1.282 +    ln  $RPM_BUILD_ROOT%{l_prefix}/libexec/git/git-http-backend \
   1.283 +        $RPM_BUILD_ROOT%{l_prefix}/cgi/git-http-backend
   1.284 +
   1.285 +    #   install GIT bash programmable completion
   1.286 +    %{l_shtool} install -c -m 644 \
   1.287 +        git-%{V_git}/contrib/completion/git-completion.bash \
   1.288 +        $RPM_BUILD_ROOT%{l_prefix}/etc/git/git.bashrc
   1.289 +
   1.290 +    #   install Cogito frontend
   1.291 +%if "%{with_cogito}" == "yes"
   1.292 +    ( cd cogito-%{V_cogito}
   1.293 +      %{l_make} %{l_mflags} install \
   1.294 +          INSTALL="%{l_shtool} install" \
   1.295 +          DESTDIR=$RPM_BUILD_ROOT \
   1.296 +          prefix=%{l_prefix}
   1.297 +    ) || exit $?
   1.298 +%endif
   1.299 +
   1.300 +    #   install StGIT add-on
   1.301 +%if "%{with_stgit}" == "yes"
   1.302 +    ( cd stgit-%{V_stgit}
   1.303 +      PATH="`pwd`/../git-%{V_git}:$PATH"
   1.304 +      %{l_prefix}/bin/python setup.py install \
   1.305 +          --root=$RPM_BUILD_ROOT \
   1.306 +          --prefix=%{l_prefix} \
   1.307 +          --install-lib=%{l_prefix}/lib/git
   1.308 +    ) || exit $?
   1.309 +%endif
   1.310 +
   1.311 +    #   install Guilt add-on
   1.312 +%if "%{with_guilt}" == "yes"
   1.313 +    ( cd guilt-%{V_guilt}
   1.314 +      %{l_make} %{l_mflags} install \
   1.315 +          PREFIX=$RPM_BUILD_ROOT%{l_prefix}
   1.316 +    ) || exit $?
   1.317 +%endif
   1.318 +
   1.319 +    #   install Tig add-on
   1.320 +%if "%{with_tig}" == "yes"
   1.321 +    ( cd tig-%{V_tig}
   1.322 +      %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
   1.323 +    ) || exit $?
   1.324 +%endif
   1.325 +
   1.326 +    #   install GC-Utils add-on
   1.327 +%if "%{with_gcutils}" == "yes"
   1.328 +    ( cd gc-utils
   1.329 +      %{l_make} %{l_mflags} \
   1.330 +          prefix=$RPM_BUILD_ROOT%{l_prefix} \
   1.331 +          mandir=$RPM_BUILD_ROOT%{l_prefix}/man \
   1.332 +          install
   1.333 +    ) || exit $?
   1.334 +%endif
   1.335 +
   1.336 +    #   install run-command script
   1.337 +    %{l_shtool} mkdir -f -p -m 755 \
   1.338 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   1.339 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   1.340 +        %{SOURCE rc.git} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   1.341 +
   1.342 +    #   strip down installation
   1.343 +    strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
   1.344 +    strip $RPM_BUILD_ROOT%{l_prefix}/libexec/git-core/* >/dev/null 2>&1 || true
   1.345 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
   1.346 +
   1.347 +    #   create additional directories
   1.348 +    %{l_shtool} mkdir -f -p -m 755 \
   1.349 +        $RPM_BUILD_ROOT%{l_prefix}/var/git/run \
   1.350 +        $RPM_BUILD_ROOT%{l_prefix}/var/git/db
   1.351 +
   1.352 +    #   determine installation files
   1.353 +    %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
   1.354 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   1.355 +        %{l_files_std} `cat perl-openpkg-files` \
   1.356 +        '%config %{l_prefix}/etc/git/*' \
   1.357 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/git/*'
   1.358 +
   1.359 +%files -f files
   1.360 +
   1.361 +%clean
   1.362 +

mercurial