-
Notifications
You must be signed in to change notification settings - Fork 1
/
20110808.uc.spec.in
203 lines (173 loc) · 5.84 KB
/
20110808.uc.spec.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
%define _tmppath %{_topdir}/BUILDROOT
#%define etc_flag %(if test -z $etc ; then echo 0; else echo 1; fi;)
#%define prefix_flag %(if test -z $prefix ; then echo 0; else echo 1; fi;)
%define is_etc %(test -z $etc && echo 0 || echo 1)
%define is_not_etc %(test -z $etc && echo 1 || echo 0)
#%define is_mandrake %(test -e /etc/mandrake-release && echo 1 || echo 0)
#%define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0)
#%define is_fedora %(test -e /etc/fedora-release && echo 1 || echo 0)
#
#%define dist redhat
#%define disttag rh
#
#%if %is_mandrake
#%define dist mandrake
#%define disttag mdk
#%endif
#%if %is_suse
#%define dist suse
#%define disttag suse
#%define kde_path /opt/kde3
#%endif
#%if %is_fedora
#%define dist fedora
#%define disttag rhfc
#%endif
%if %{is_etc}
%define _sysconfdir %{_prefix}/etc
%endif
%define PACKAGE_HOME %{_datadir}/@PACKAGE@
Name: @PACKAGE_NAME@
Version: @PACKAGE_VERSION@
Release: @PACKAGE_RELEASE@%{?dist}
Summary: template for uc project example
License: GPLv3
Group: Development/Libraries
Url: @PACKAGE_URL@
Source0: %{name}-%{version}.tar.gz
%if %{is_etc}
Prefix: %_prefix
%endif
#BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id} -u -n)
#BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Vendor: Cnangel <[email protected]>
Packager: Cnangel <[email protected]>
#Requires:
BuildRequires: cppunit-devel
#%if %{with libiconv}
#BuildRequires: libiconv-devel
#%endif
#%bcond_with libiconv
%description
%{name} is a template for automake.
%package devel
Summary: Header files, libraries for %{name}.
Group: %{group}
Requires: %{name} = %{version}-%{release}
%description devel
This package contains the header files and static libraries for %{name}.
If you like to develop programs using %{name}, you will need to install %{name}-devel.
%package data
Summary: Data for %{name}.
Group: %{group}
Requires: %{name} = %{version}-%{release}
%description data
This package contains the training data, testing data and some useful data for %{name}, if need, you must install %{name}-data.
%package doc
Summary: Development documentation for %{name}.
Group: %{group}
Requires: %{name} = %{version}-%{release}
%description doc
This package contains the development documentation and introduction or information for %{name}.
If you want to known develop programs and application about %{name}, you will need to install %{name}-doc.
#%package debuginfo
#Summary: Debug information files for %{name}.
#Group: %{group}
#Requires: %{name} = %{version}-%{release}
#
#%description debuginfo
#This package contains the debug information files and source files for %{name}.
#If you want to known develop programs and application about %{name}, you will need to install %{name}-debuginfo.
%prep
%setup -q
%build
%configure %{?_with_libiconv} %{?_with_tomcat}
# for rpmbuild --define='_with_foo_macro WITH_FOO=1' -ba uc.spec
make %{?_smp_mflags} %{?_with_foo_macro}
make check
%install
rm -rf $RPM_BUILD_ROOT
#mkdir -p $RPM_BUILD_ROOT%{PACKAGE_HOME}/conf
#mkdir -p $RPM_BUILD_ROOT%{PACKAGE_HOME}/include
#mkdir -p $RPM_BUILD_ROOT%{PACKAGE_HOME}/lib
#cp -r conf/* $RPM_BUILD_ROOT%{PACKAGE_HOME}/conf
#cp -r include/* $RPM_BUILD_ROOT%{PACKAGE_HOME}/include
#cp -r lib/* $RPM_BUILD_ROOT%{PACKAGE_HOME}/lib
%makeinstall
#install -p -m 0644 include/* $RPM_BUILD_ROOT%{PACKAGE_HOME}/include
#install -p lib/* $RPM_BUILD_ROOT%{PACKAGE_HOME}/lib
#install -p -m 0644 data/* $RPM_BUILD_ROOT%{PACKAGE_HOME}/data
# install -p -m 0644 doc/* $RPM_BUILD_ROOT%{_docdir}
# cp -rf doc/* $RPM_BUILD_ROOT%{_docdir}
# delete tmp file
#find $RPM_BUILD_ROOT%{PACKAGE_HOME} \( -name "Makefile*" \) -exec rm -rf '{}' \;
#find $RPM_BUILD_ROOT%{_docdir} \( -name "Makefile*" \) -exec rm -rf '{}' \;
#rm -rf `find $RPM_BUILD_ROOT%{PACKAGE_HOME} -name ".svn*"`
#rm -rf `find $RPM_BUILD_ROOT%{_docdir} -name ".svn*"`
%clean
rm -rf $RPM_BUILD_ROOT
%post
%if %{is_etc}
ldconfig
%endif
%post devel
if test "x$RPM_INSTALL_PREFIX0" != "x" ; then
%{__perl} -pi -e"s|^libdir='[^\']*'|libdir='$RPM_INSTALL_PREFIX0/%{_lib}'|" $RPM_INSTALL_PREFIX0/%{_lib}/libuc.la
%{__perl} -pi -e"s|/usr|$RPM_INSTALL_PREFIX0|" $RPM_INSTALL_PREFIX0/%{_lib}/pkgconfig/libuc.pc
%{__perl} -pi -e"s|^prefix=\"[^\"]*\"|prefix=\"$RPM_INSTALL_PREFIX0\"|" $RPM_INSTALL_PREFIX0/bin/uc-config
fi
%postun
%if %{is_etc}
ldconfig
%endif
%files
%defattr(-,root,root,-)
#%doc AUTHORS COPYING ChangeLog INSTALL NEWS README
%{_libdir}/*.so*
%attr(755,root,root) %{_bindir}
%config(noreplace) %attr(666,root,root) %{_sysconfdir}/@PACKAGE_NAME@/*
#%{_infodir}
#%{_mandir}
#%config(noreplace) %attr(666,root,root) %{PACKAGE_HOME}/conf/*
%{PACKAGE_HOME}/include/*
%{PACKAGE_HOME}/lib/*
%attr(755,root,root) %{PACKAGE_HOME}/scripts/*
%attr(755,root,root) %{PACKAGE_HOME}/tools/*
%files devel
%defattr(-,root,root,-)
%{_includedir}
%{_libdir}/*.a
%exclude %{_libdir}/*.la
%{_libdir}/pkgconfig/*.pc
%files data
%defattr(-,root,root,-)
%{PACKAGE_HOME}/data
%files doc
%defattr(-,root,root,-)
%{_docdir}
#%_iconsdir/*/*/*/*.png
#%_localedir/*/*/*.mo
#%files debuginfo
#%defattr(-,root,root,-)
#/usr/lib
#/usr/src
%changelog
* Wed Jun 09 2010 Cnangel <[email protected]> 0.0.4-1
- Add uc-config and uc.pc for development.
- Add uc.m4 for configure paths.
* Wed Aug 19 2009 Cnangel <[email protected]> 0.0.3
- Add more headers design;
- Add test, you can use Check for c or Cppunit for c++(default: cppunit);
- Add tools and script directory, and delete not use files like Makefile.in etc.;
- Add Macro: DISTCLEANFILES
* Mon Aug 03 2009 Cnangel <[email protected]> 0.0.2
- Improve version control and add data package;
- Add doc/doxygen to rpm;
- Add *.pc.in for pkgconfig;
- Replace some variables like @PACKAGE@ etc.;
* Mon Jun 08 2009 Cnangel <[email protected]> 0.0.1
- Add LT_MAJOR, LT_REVISION and LT_AGE like lib*.so.1.0.0;
- Add DOXYGEN_OUTPUT_DIR doc/doxygen;
- You can visit http://my.huhoo.net/study for update.
# -fin-