Show More
@@ -1,160 +1,160 b'' | |||||
1 | #!/bin/bash -e |
|
1 | #!/bin/bash -e | |
2 | # |
|
2 | # | |
3 | # Build a Mercurial RPM from the current repo |
|
3 | # Build a Mercurial RPM from the current repo | |
4 | # |
|
4 | # | |
5 | # Tested on |
|
5 | # Tested on | |
6 | # - Fedora 20 |
|
6 | # - Fedora 20 | |
7 | # - CentOS 5 |
|
7 | # - CentOS 5 | |
8 | # - centOS 6 |
|
8 | # - centOS 6 | |
9 |
|
9 | |||
10 | . $(dirname $0)/packagelib.sh |
|
10 | . $(dirname $0)/packagelib.sh | |
11 |
|
11 | |||
12 | BUILD=1 |
|
12 | BUILD=1 | |
13 | RPMBUILDDIR="$PWD/rpmbuild" |
|
13 | RPMBUILDDIR="$PWD/rpmbuild" | |
14 |
|
14 | |||
15 | while [ "$1" ]; do |
|
15 | while [ "$1" ]; do | |
16 | case "$1" in |
|
16 | case "$1" in | |
17 | --prepare ) |
|
17 | --prepare ) | |
18 | shift |
|
18 | shift | |
19 | BUILD= |
|
19 | BUILD= | |
20 | ;; |
|
20 | ;; | |
21 | --withpython | --with-python) |
|
21 | --withpython | --with-python) | |
22 | shift |
|
22 | shift | |
23 | PYTHONVER=2.7.16 |
|
23 | PYTHONVER=2.7.16 | |
24 | PYTHONMD5=f1a2ace631068444831d01485466ece0 |
|
24 | PYTHONMD5=f1a2ace631068444831d01485466ece0 | |
25 | ;; |
|
25 | ;; | |
26 | --rpmbuilddir ) |
|
26 | --rpmbuilddir ) | |
27 | shift |
|
27 | shift | |
28 | RPMBUILDDIR="$1" |
|
28 | RPMBUILDDIR="$1" | |
29 | shift |
|
29 | shift | |
30 | ;; |
|
30 | ;; | |
31 | * ) |
|
31 | * ) | |
32 | echo "Invalid parameter $1!" 1>&2 |
|
32 | echo "Invalid parameter $1!" 1>&2 | |
33 | exit 1 |
|
33 | exit 1 | |
34 | ;; |
|
34 | ;; | |
35 | esac |
|
35 | esac | |
36 | done |
|
36 | done | |
37 |
|
37 | |||
38 | cd "`dirname $0`/../.." |
|
38 | cd "`dirname $0`/../.." | |
39 |
|
39 | |||
40 | specfile=$PWD/contrib/packaging/mercurial.spec |
|
40 | specfile=$PWD/contrib/packaging/mercurial.spec | |
41 | if [ ! -f $specfile ]; then |
|
41 | if [ ! -f $specfile ]; then | |
42 | echo "Cannot find $specfile!" 1>&2 |
|
42 | echo "Cannot find $specfile!" 1>&2 | |
43 | exit 1 |
|
43 | exit 1 | |
44 | fi |
|
44 | fi | |
45 |
|
45 | |||
46 | if [ ! -d .hg ]; then |
|
46 | if [ ! -d .hg ]; then | |
47 | echo 'You are not inside a Mercurial repository!' 1>&2 |
|
47 | echo 'You are not inside a Mercurial repository!' 1>&2 | |
48 | exit 1 |
|
48 | exit 1 | |
49 | fi |
|
49 | fi | |
50 |
|
50 | |||
51 | gethgversion |
|
51 | gethgversion | |
52 |
|
52 | |||
53 | if [ -z "$type" ] ; then |
|
53 | if [ -z "$type" ] ; then | |
54 | release=1 |
|
54 | release=1 | |
55 | else |
|
55 | else | |
56 | release=0.9_$type |
|
56 | release=0.9_$type | |
57 | fi |
|
57 | fi | |
58 |
|
58 | |||
59 | if [ -n "$distance" ] ; then |
|
59 | if [ -n "$distance" ] ; then | |
60 | release=$release+${distance}_${node} |
|
60 | release=$release+${distance}_${node} | |
61 | fi |
|
61 | fi | |
62 |
|
62 | |||
63 | if [ "$PYTHONVER" ]; then |
|
63 | if [ "$PYTHONVER" ]; then | |
64 | release=$release+$PYTHONVER |
|
64 | release=$release+$PYTHONVER | |
65 | RPMPYTHONVER=$PYTHONVER |
|
65 | RPMPYTHONVER=$PYTHONVER | |
66 | else |
|
66 | else | |
67 | RPMPYTHONVER=%{nil} |
|
67 | RPMPYTHONVER=%{nil} | |
68 | fi |
|
68 | fi | |
69 |
|
69 | |||
70 | mkdir -p $RPMBUILDDIR/{SOURCES,BUILD,SRPMS,RPMS} |
|
70 | mkdir -p $RPMBUILDDIR/{SOURCES,BUILD,SRPMS,RPMS} | |
71 | $HG archive -t tgz $RPMBUILDDIR/SOURCES/mercurial-$version-$release.tar.gz |
|
71 | $HG archive -t tgz $RPMBUILDDIR/SOURCES/mercurial-$version-$release.tar.gz | |
72 | if [ "$PYTHONVER" ]; then |
|
72 | if [ "$PYTHONVER" ]; then | |
73 | ( |
|
73 | ( | |
74 | mkdir -p build |
|
74 | mkdir -p build | |
75 | cd build |
|
75 | cd build | |
76 | PYTHON_SRCFILE=Python-$PYTHONVER.tgz |
|
76 | PYTHON_SRCFILE=Python-$PYTHONVER.tgz | |
77 | [ -f $PYTHON_SRCFILE ] || curl -Lo $PYTHON_SRCFILE http://www.python.org/ftp/python/$PYTHONVER/$PYTHON_SRCFILE |
|
77 | [ -f $PYTHON_SRCFILE ] || curl -Lo $PYTHON_SRCFILE http://www.python.org/ftp/python/$PYTHONVER/$PYTHON_SRCFILE | |
78 | if [ "$PYTHONMD5" ]; then |
|
78 | if [ "$PYTHONMD5" ]; then | |
79 | echo "$PYTHONMD5 $PYTHON_SRCFILE" | md5sum -w -c |
|
79 | echo "$PYTHONMD5 $PYTHON_SRCFILE" | md5sum -w -c | |
80 | fi |
|
80 | fi | |
81 | ln -f $PYTHON_SRCFILE $RPMBUILDDIR/SOURCES/$PYTHON_SRCFILE |
|
81 | ln -f $PYTHON_SRCFILE $RPMBUILDDIR/SOURCES/$PYTHON_SRCFILE | |
82 |
|
82 | |||
83 | DOCUTILSVER=`sed -ne "s/^%global docutilsname docutils-//p" $specfile` |
|
83 | DOCUTILSVER=`sed -ne "s/^%global docutilsname docutils-//p" $specfile` | |
84 | DOCUTILS_SRCFILE=docutils-$DOCUTILSVER.tar.gz |
|
84 | DOCUTILS_SRCFILE=docutils-$DOCUTILSVER.tar.gz | |
85 | [ -f $DOCUTILS_SRCFILE ] || curl -Lo $DOCUTILS_SRCFILE http://downloads.sourceforge.net/project/docutils/docutils/$DOCUTILSVER/$DOCUTILS_SRCFILE |
|
85 | [ -f $DOCUTILS_SRCFILE ] || curl -Lo $DOCUTILS_SRCFILE http://downloads.sourceforge.net/project/docutils/docutils/$DOCUTILSVER/$DOCUTILS_SRCFILE | |
86 | DOCUTILSMD5=`sed -ne "s/^%global docutilsmd5 //p" $specfile` |
|
86 | DOCUTILSMD5=`sed -ne "s/^%global docutilsmd5 //p" $specfile` | |
87 | if [ "$DOCUTILSMD5" ]; then |
|
87 | if [ "$DOCUTILSMD5" ]; then | |
88 | echo "$DOCUTILSMD5 $DOCUTILS_SRCFILE" | md5sum -w -c |
|
88 | echo "$DOCUTILSMD5 $DOCUTILS_SRCFILE" | md5sum -w -c | |
89 | fi |
|
89 | fi | |
90 | ln -f $DOCUTILS_SRCFILE $RPMBUILDDIR/SOURCES/$DOCUTILS_SRCFILE |
|
90 | ln -f $DOCUTILS_SRCFILE $RPMBUILDDIR/SOURCES/$DOCUTILS_SRCFILE | |
91 | ) |
|
91 | ) | |
92 | fi |
|
92 | fi | |
93 |
|
93 | |||
94 | mkdir -p $RPMBUILDDIR/SPECS |
|
94 | mkdir -p $RPMBUILDDIR/SPECS | |
95 | rpmspec=$RPMBUILDDIR/SPECS/mercurial.spec |
|
95 | rpmspec=$RPMBUILDDIR/SPECS/mercurial.spec | |
96 |
|
96 | |||
97 | sed -e "s,^Version:.*,Version: $version," \ |
|
97 | sed -e "s,^Version:.*,Version: $version," \ | |
98 | -e "s,^Release:.*,Release: $release," \ |
|
98 | -e "s,^Release:.*,Release: $release," \ | |
99 | $specfile > $rpmspec |
|
99 | $specfile > $rpmspec | |
100 |
|
100 | |||
101 | echo >> $rpmspec |
|
101 | echo >> $rpmspec | |
102 | echo "%changelog" >> $rpmspec |
|
102 | echo "%changelog" >> $rpmspec | |
103 |
|
103 | |||
104 | if echo $version | grep '+' > /dev/null 2>&1; then |
|
104 | if echo $version | grep '+' > /dev/null 2>&1; then | |
105 | latesttag="`echo $version | sed -e 's/+.*//'`" |
|
105 | latesttag="`echo $version | sed -e 's/+.*//'`" | |
106 | $HG log -r .:"$latesttag" -fM \ |
|
106 | $HG log -r .:"$latesttag" -fM \ | |
107 | --template '{date|hgdate}\t{author}\t{desc|firstline}\n' | python -c ' |
|
107 | --template '{date|hgdate}\t{author}\t{desc|firstline}\n' | python -c ' | |
108 | import sys, time |
|
108 | import sys, time | |
109 |
|
109 | |||
110 | def datestr(date, format): |
|
110 | def datestr(date, format): | |
111 | return time.strftime(format, time.gmtime(float(date[0]) - date[1])) |
|
111 | return time.strftime(format, time.gmtime(float(date[0]) - date[1])) | |
112 |
|
112 | |||
113 | changelog = [] |
|
113 | changelog = [] | |
114 | for l in sys.stdin.readlines(): |
|
114 | for l in sys.stdin.readlines(): | |
115 | tok = l.split("\t") |
|
115 | tok = l.split("\t") | |
116 | hgdate = tuple(int(v) for v in tok[0].split()) |
|
116 | hgdate = tuple(int(v) for v in tok[0].split()) | |
117 | changelog.append((datestr(hgdate, "%F"), tok[1], hgdate, tok[2])) |
|
117 | changelog.append((datestr(hgdate, "%F"), tok[1], hgdate, tok[2])) | |
118 | prevtitle = "" |
|
118 | prevtitle = "" | |
119 | for l in sorted(changelog, reverse=True): |
|
119 | for l in sorted(changelog, reverse=True): | |
120 | title = "* %s %s" % (datestr(l[2], "%a %b %d %Y"), l[1]) |
|
120 | title = "* %s %s" % (datestr(l[2], "%a %b %d %Y"), l[1]) | |
121 | if prevtitle != title: |
|
121 | if prevtitle != title: | |
122 | prevtitle = title |
|
122 | prevtitle = title | |
123 |
|
123 | |||
124 |
print |
|
124 | print(title) | |
125 |
print |
|
125 | print("- %s" % l[3].strip()) | |
126 | ' >> $rpmspec |
|
126 | ' >> $rpmspec | |
127 |
|
127 | |||
128 | else |
|
128 | else | |
129 |
|
129 | |||
130 | $HG log \ |
|
130 | $HG log \ | |
131 | --template '{date|hgdate}\t{author}\t{desc|firstline}\n' \ |
|
131 | --template '{date|hgdate}\t{author}\t{desc|firstline}\n' \ | |
132 | .hgtags | python -c ' |
|
132 | .hgtags | python -c ' | |
133 | import sys, time |
|
133 | import sys, time | |
134 |
|
134 | |||
135 | def datestr(date, format): |
|
135 | def datestr(date, format): | |
136 | return time.strftime(format, time.gmtime(float(date[0]) - date[1])) |
|
136 | return time.strftime(format, time.gmtime(float(date[0]) - date[1])) | |
137 |
|
137 | |||
138 | for l in sys.stdin.readlines(): |
|
138 | for l in sys.stdin.readlines(): | |
139 | tok = l.split("\t") |
|
139 | tok = l.split("\t") | |
140 | hgdate = tuple(int(v) for v in tok[0].split()) |
|
140 | hgdate = tuple(int(v) for v in tok[0].split()) | |
141 |
print |
|
141 | print("* %s %s\n- %s" % (datestr(hgdate, "%a %b %d %Y"), tok[1], tok[2])) | |
142 | ' >> $rpmspec |
|
142 | ' >> $rpmspec | |
143 |
|
143 | |||
144 | fi |
|
144 | fi | |
145 |
|
145 | |||
146 | sed -i \ |
|
146 | sed -i \ | |
147 | -e "s/^%define withpython.*$/%define withpython $RPMPYTHONVER/" \ |
|
147 | -e "s/^%define withpython.*$/%define withpython $RPMPYTHONVER/" \ | |
148 | $rpmspec |
|
148 | $rpmspec | |
149 |
|
149 | |||
150 | if [ "$BUILD" ]; then |
|
150 | if [ "$BUILD" ]; then | |
151 | rpmbuild --define "_topdir $RPMBUILDDIR" -ba $rpmspec --clean |
|
151 | rpmbuild --define "_topdir $RPMBUILDDIR" -ba $rpmspec --clean | |
152 | if [ $? = 0 ]; then |
|
152 | if [ $? = 0 ]; then | |
153 | echo |
|
153 | echo | |
154 | echo "Built packages for $version-$release:" |
|
154 | echo "Built packages for $version-$release:" | |
155 | find $RPMBUILDDIR/*RPMS/ -type f -newer $rpmspec |
|
155 | find $RPMBUILDDIR/*RPMS/ -type f -newer $rpmspec | |
156 | fi |
|
156 | fi | |
157 | else |
|
157 | else | |
158 | echo "Prepared sources for $version-$release $rpmspec are in $RPMBUILDDIR/SOURCES/ - use like:" |
|
158 | echo "Prepared sources for $version-$release $rpmspec are in $RPMBUILDDIR/SOURCES/ - use like:" | |
159 | echo "rpmbuild --define '_topdir $RPMBUILDDIR' -ba $rpmspec --clean" |
|
159 | echo "rpmbuild --define '_topdir $RPMBUILDDIR' -ba $rpmspec --clean" | |
160 | fi |
|
160 | fi |
@@ -1,164 +1,164 b'' | |||||
1 | %global emacs_lispdir %{_datadir}/emacs/site-lisp |
|
1 | %global emacs_lispdir %{_datadir}/emacs/site-lisp | |
2 |
|
2 | |||
3 | %define withpython %{nil} |
|
3 | %define withpython %{nil} | |
4 |
|
4 | |||
5 | %if "%{?withpython}" |
|
5 | %if "%{?withpython}" | |
6 |
|
6 | |||
7 | %global pythonver %{withpython} |
|
7 | %global pythonver %{withpython} | |
8 | %global pythonname Python-%{withpython} |
|
8 | %global pythonname Python-%{withpython} | |
9 | %global docutilsname docutils-0.14 |
|
9 | %global docutilsname docutils-0.14 | |
10 | %global docutilsmd5 c53768d63db3873b7d452833553469de |
|
10 | %global docutilsmd5 c53768d63db3873b7d452833553469de | |
11 | %global pythonhg python-hg |
|
11 | %global pythonhg python-hg | |
12 | %global hgpyprefix /opt/%{pythonhg} |
|
12 | %global hgpyprefix /opt/%{pythonhg} | |
13 | # byte compilation will fail on some some Python /test/ files |
|
13 | # byte compilation will fail on some some Python /test/ files | |
14 | %global _python_bytecompile_errors_terminate_build 0 |
|
14 | %global _python_bytecompile_errors_terminate_build 0 | |
15 |
|
15 | |||
16 | %else |
|
16 | %else | |
17 |
|
17 | |||
18 |
%global pythonver %(python -c 'import sys;print |
|
18 | %global pythonver %(python -c 'import sys;print(".".join(map(str, sys.version_info[:2])))') | |
19 |
|
19 | |||
20 | %endif |
|
20 | %endif | |
21 |
|
21 | |||
22 | Summary: A fast, lightweight Source Control Management system |
|
22 | Summary: A fast, lightweight Source Control Management system | |
23 | Name: mercurial |
|
23 | Name: mercurial | |
24 | Version: snapshot |
|
24 | Version: snapshot | |
25 | Release: 0 |
|
25 | Release: 0 | |
26 | License: GPLv2+ |
|
26 | License: GPLv2+ | |
27 | Group: Development/Tools |
|
27 | Group: Development/Tools | |
28 | URL: https://mercurial-scm.org/ |
|
28 | URL: https://mercurial-scm.org/ | |
29 | Source0: %{name}-%{version}-%{release}.tar.gz |
|
29 | Source0: %{name}-%{version}-%{release}.tar.gz | |
30 | %if "%{?withpython}" |
|
30 | %if "%{?withpython}" | |
31 | Source1: %{pythonname}.tgz |
|
31 | Source1: %{pythonname}.tgz | |
32 | Source2: %{docutilsname}.tar.gz |
|
32 | Source2: %{docutilsname}.tar.gz | |
33 | %endif |
|
33 | %endif | |
34 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root |
|
34 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root | |
35 |
|
35 | |||
36 | BuildRequires: make, gcc, gettext |
|
36 | BuildRequires: make, gcc, gettext | |
37 | %if "%{?withpython}" |
|
37 | %if "%{?withpython}" | |
38 | BuildRequires: readline-devel, openssl-devel, ncurses-devel, zlib-devel, bzip2-devel |
|
38 | BuildRequires: readline-devel, openssl-devel, ncurses-devel, zlib-devel, bzip2-devel | |
39 | %else |
|
39 | %else | |
40 | BuildRequires: python >= 2.7, python-devel, python-docutils >= 0.5 |
|
40 | BuildRequires: python >= 2.7, python-devel, python-docutils >= 0.5 | |
41 | Requires: python >= 2.7 |
|
41 | Requires: python >= 2.7 | |
42 | %endif |
|
42 | %endif | |
43 | # The hgk extension uses the wish tcl interpreter, but we don't enforce it |
|
43 | # The hgk extension uses the wish tcl interpreter, but we don't enforce it | |
44 | #Requires: tk |
|
44 | #Requires: tk | |
45 |
|
45 | |||
46 | %description |
|
46 | %description | |
47 | Mercurial is a fast, lightweight source control management system designed |
|
47 | Mercurial is a fast, lightweight source control management system designed | |
48 | for efficient handling of very large distributed projects. |
|
48 | for efficient handling of very large distributed projects. | |
49 |
|
49 | |||
50 | %prep |
|
50 | %prep | |
51 |
|
51 | |||
52 | %if "%{?withpython}" |
|
52 | %if "%{?withpython}" | |
53 | %setup -q -n mercurial-%{version}-%{release} -a1 -a2 |
|
53 | %setup -q -n mercurial-%{version}-%{release} -a1 -a2 | |
54 | # despite the comments in cgi.py, we do this to prevent rpmdeps from picking /usr/local/bin/python up |
|
54 | # despite the comments in cgi.py, we do this to prevent rpmdeps from picking /usr/local/bin/python up | |
55 | sed -i '1c#! /usr/bin/env python' %{pythonname}/Lib/cgi.py |
|
55 | sed -i '1c#! /usr/bin/env python' %{pythonname}/Lib/cgi.py | |
56 | %else |
|
56 | %else | |
57 | %setup -q -n mercurial-%{version}-%{release} |
|
57 | %setup -q -n mercurial-%{version}-%{release} | |
58 | %endif |
|
58 | %endif | |
59 |
|
59 | |||
60 | %build |
|
60 | %build | |
61 |
|
61 | |||
62 | %if "%{?withpython}" |
|
62 | %if "%{?withpython}" | |
63 |
|
63 | |||
64 | PYPATH=$PWD/%{pythonname} |
|
64 | PYPATH=$PWD/%{pythonname} | |
65 | cd $PYPATH |
|
65 | cd $PYPATH | |
66 | ./configure --prefix=%{hgpyprefix} |
|
66 | ./configure --prefix=%{hgpyprefix} | |
67 | make all %{?_smp_mflags} |
|
67 | make all %{?_smp_mflags} | |
68 | cd - |
|
68 | cd - | |
69 |
|
69 | |||
70 | cd %{docutilsname} |
|
70 | cd %{docutilsname} | |
71 | LD_LIBRARY_PATH=$PYPATH $PYPATH/python setup.py build |
|
71 | LD_LIBRARY_PATH=$PYPATH $PYPATH/python setup.py build | |
72 | cd - |
|
72 | cd - | |
73 |
|
73 | |||
74 | # verify Python environment |
|
74 | # verify Python environment | |
75 | LD_LIBRARY_PATH=$PYPATH PYTHONPATH=$PWD/%{docutilsname} $PYPATH/python -c 'import sys, zlib, bz2, ssl, curses, readline' |
|
75 | LD_LIBRARY_PATH=$PYPATH PYTHONPATH=$PWD/%{docutilsname} $PYPATH/python -c 'import sys, zlib, bz2, ssl, curses, readline' | |
76 |
|
76 | |||
77 | # set environment for make |
|
77 | # set environment for make | |
78 | export PATH=$PYPATH:$PATH |
|
78 | export PATH=$PYPATH:$PATH | |
79 | export LD_LIBRARY_PATH=$PYPATH |
|
79 | export LD_LIBRARY_PATH=$PYPATH | |
80 | export CFLAGS="-L $PYPATH" |
|
80 | export CFLAGS="-L $PYPATH" | |
81 | export PYTHONPATH=$PWD/%{docutilsname} |
|
81 | export PYTHONPATH=$PWD/%{docutilsname} | |
82 |
|
82 | |||
83 | %endif |
|
83 | %endif | |
84 |
|
84 | |||
85 | make all |
|
85 | make all | |
86 | make -C contrib/chg |
|
86 | make -C contrib/chg | |
87 |
|
87 | |||
88 | %install |
|
88 | %install | |
89 | rm -rf $RPM_BUILD_ROOT |
|
89 | rm -rf $RPM_BUILD_ROOT | |
90 |
|
90 | |||
91 | %if "%{?withpython}" |
|
91 | %if "%{?withpython}" | |
92 |
|
92 | |||
93 | PYPATH=$PWD/%{pythonname} |
|
93 | PYPATH=$PWD/%{pythonname} | |
94 | cd $PYPATH |
|
94 | cd $PYPATH | |
95 | make install DESTDIR=$RPM_BUILD_ROOT |
|
95 | make install DESTDIR=$RPM_BUILD_ROOT | |
96 | # these .a are not necessary and they are readonly and strip fails - kill them! |
|
96 | # these .a are not necessary and they are readonly and strip fails - kill them! | |
97 | rm -f %{buildroot}%{hgpyprefix}/lib/{,python2.*/config}/libpython2.*.a |
|
97 | rm -f %{buildroot}%{hgpyprefix}/lib/{,python2.*/config}/libpython2.*.a | |
98 | cd - |
|
98 | cd - | |
99 |
|
99 | |||
100 | cd %{docutilsname} |
|
100 | cd %{docutilsname} | |
101 | LD_LIBRARY_PATH=$PYPATH $PYPATH/python setup.py install --root="$RPM_BUILD_ROOT" |
|
101 | LD_LIBRARY_PATH=$PYPATH $PYPATH/python setup.py install --root="$RPM_BUILD_ROOT" | |
102 | cd - |
|
102 | cd - | |
103 |
|
103 | |||
104 | PATH=$PYPATH:$PATH LD_LIBRARY_PATH=$PYPATH make install DESTDIR=$RPM_BUILD_ROOT PREFIX=%{hgpyprefix} MANDIR=%{_mandir} |
|
104 | PATH=$PYPATH:$PATH LD_LIBRARY_PATH=$PYPATH make install DESTDIR=$RPM_BUILD_ROOT PREFIX=%{hgpyprefix} MANDIR=%{_mandir} | |
105 | mkdir -p $RPM_BUILD_ROOT%{_bindir} |
|
105 | mkdir -p $RPM_BUILD_ROOT%{_bindir} | |
106 | ( cd $RPM_BUILD_ROOT%{_bindir}/ && ln -s ../..%{hgpyprefix}/bin/hg . ) |
|
106 | ( cd $RPM_BUILD_ROOT%{_bindir}/ && ln -s ../..%{hgpyprefix}/bin/hg . ) | |
107 | ( cd $RPM_BUILD_ROOT%{_bindir}/ && ln -s ../..%{hgpyprefix}/bin/python2.? %{pythonhg} ) |
|
107 | ( cd $RPM_BUILD_ROOT%{_bindir}/ && ln -s ../..%{hgpyprefix}/bin/python2.? %{pythonhg} ) | |
108 |
|
108 | |||
109 | %else |
|
109 | %else | |
110 |
|
110 | |||
111 | make install DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix} MANDIR=%{_mandir} |
|
111 | make install DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix} MANDIR=%{_mandir} | |
112 |
|
112 | |||
113 | %endif |
|
113 | %endif | |
114 |
|
114 | |||
115 | install -m 755 contrib/chg/chg $RPM_BUILD_ROOT%{_bindir}/ |
|
115 | install -m 755 contrib/chg/chg $RPM_BUILD_ROOT%{_bindir}/ | |
116 | install -m 755 contrib/hgk $RPM_BUILD_ROOT%{_bindir}/ |
|
116 | install -m 755 contrib/hgk $RPM_BUILD_ROOT%{_bindir}/ | |
117 | install -m 755 contrib/hg-ssh $RPM_BUILD_ROOT%{_bindir}/ |
|
117 | install -m 755 contrib/hg-ssh $RPM_BUILD_ROOT%{_bindir}/ | |
118 |
|
118 | |||
119 | bash_completion_dir=$RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d |
|
119 | bash_completion_dir=$RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d | |
120 | mkdir -p $bash_completion_dir |
|
120 | mkdir -p $bash_completion_dir | |
121 | install -m 644 contrib/bash_completion $bash_completion_dir/mercurial.sh |
|
121 | install -m 644 contrib/bash_completion $bash_completion_dir/mercurial.sh | |
122 |
|
122 | |||
123 | zsh_completion_dir=$RPM_BUILD_ROOT%{_datadir}/zsh/site-functions |
|
123 | zsh_completion_dir=$RPM_BUILD_ROOT%{_datadir}/zsh/site-functions | |
124 | mkdir -p $zsh_completion_dir |
|
124 | mkdir -p $zsh_completion_dir | |
125 | install -m 644 contrib/zsh_completion $zsh_completion_dir/_mercurial |
|
125 | install -m 644 contrib/zsh_completion $zsh_completion_dir/_mercurial | |
126 |
|
126 | |||
127 | mkdir -p $RPM_BUILD_ROOT%{emacs_lispdir} |
|
127 | mkdir -p $RPM_BUILD_ROOT%{emacs_lispdir} | |
128 | install -m 644 contrib/mercurial.el $RPM_BUILD_ROOT%{emacs_lispdir}/ |
|
128 | install -m 644 contrib/mercurial.el $RPM_BUILD_ROOT%{emacs_lispdir}/ | |
129 | install -m 644 contrib/mq.el $RPM_BUILD_ROOT%{emacs_lispdir}/ |
|
129 | install -m 644 contrib/mq.el $RPM_BUILD_ROOT%{emacs_lispdir}/ | |
130 |
|
130 | |||
131 | mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/mercurial/hgrc.d |
|
131 | mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/mercurial/hgrc.d | |
132 |
|
132 | |||
133 | %clean |
|
133 | %clean | |
134 | rm -rf $RPM_BUILD_ROOT |
|
134 | rm -rf $RPM_BUILD_ROOT | |
135 |
|
135 | |||
136 | %files |
|
136 | %files | |
137 | %defattr(-,root,root,-) |
|
137 | %defattr(-,root,root,-) | |
138 | %doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html *.cgi contrib/*.fcgi |
|
138 | %doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html *.cgi contrib/*.fcgi | |
139 | %doc %attr(644,root,root) %{_mandir}/man?/hg* |
|
139 | %doc %attr(644,root,root) %{_mandir}/man?/hg* | |
140 | %doc %attr(644,root,root) contrib/*.svg |
|
140 | %doc %attr(644,root,root) contrib/*.svg | |
141 | %dir %{_datadir}/zsh/ |
|
141 | %dir %{_datadir}/zsh/ | |
142 | %dir %{_datadir}/zsh/site-functions/ |
|
142 | %dir %{_datadir}/zsh/site-functions/ | |
143 | %{_datadir}/zsh/site-functions/_mercurial |
|
143 | %{_datadir}/zsh/site-functions/_mercurial | |
144 | %dir %{_datadir}/emacs/site-lisp/ |
|
144 | %dir %{_datadir}/emacs/site-lisp/ | |
145 | %{_datadir}/emacs/site-lisp/mercurial.el |
|
145 | %{_datadir}/emacs/site-lisp/mercurial.el | |
146 | %{_datadir}/emacs/site-lisp/mq.el |
|
146 | %{_datadir}/emacs/site-lisp/mq.el | |
147 | %{_bindir}/hg |
|
147 | %{_bindir}/hg | |
148 | %{_bindir}/chg |
|
148 | %{_bindir}/chg | |
149 | %{_bindir}/hgk |
|
149 | %{_bindir}/hgk | |
150 | %{_bindir}/hg-ssh |
|
150 | %{_bindir}/hg-ssh | |
151 | %dir %{_sysconfdir}/bash_completion.d/ |
|
151 | %dir %{_sysconfdir}/bash_completion.d/ | |
152 | %config(noreplace) %{_sysconfdir}/bash_completion.d/mercurial.sh |
|
152 | %config(noreplace) %{_sysconfdir}/bash_completion.d/mercurial.sh | |
153 | %dir %{_sysconfdir}/mercurial |
|
153 | %dir %{_sysconfdir}/mercurial | |
154 | %dir %{_sysconfdir}/mercurial/hgrc.d |
|
154 | %dir %{_sysconfdir}/mercurial/hgrc.d | |
155 | %if "%{?withpython}" |
|
155 | %if "%{?withpython}" | |
156 | %{_bindir}/%{pythonhg} |
|
156 | %{_bindir}/%{pythonhg} | |
157 | %{hgpyprefix} |
|
157 | %{hgpyprefix} | |
158 | %else |
|
158 | %else | |
159 | %{_libdir}/python%{pythonver}/site-packages/%{name}-*-py%{pythonver}.egg-info |
|
159 | %{_libdir}/python%{pythonver}/site-packages/%{name}-*-py%{pythonver}.egg-info | |
160 | %{_libdir}/python%{pythonver}/site-packages/%{name} |
|
160 | %{_libdir}/python%{pythonver}/site-packages/%{name} | |
161 | %{_libdir}/python%{pythonver}/site-packages/hgext |
|
161 | %{_libdir}/python%{pythonver}/site-packages/hgext | |
162 | %{_libdir}/python%{pythonver}/site-packages/hgext3rd |
|
162 | %{_libdir}/python%{pythonver}/site-packages/hgext3rd | |
163 | %{_libdir}/python%{pythonver}/site-packages/hgdemandimport |
|
163 | %{_libdir}/python%{pythonver}/site-packages/hgdemandimport | |
164 | %endif |
|
164 | %endif |
General Comments 0
You need to be logged in to leave comments.
Login now