Last active
August 29, 2015 14:19
-
-
Save johnelf/e8be3fab9da22857fd09 to your computer and use it in GitHub Desktop.
Spec file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name: bbs | |
Summary: BBS | |
Version: 1.0 | |
Release: 1 | |
URL: example.com | |
Source: %{name}-%{version}-%{release}.tar.gz | |
License: MIT | |
Group: Applications/Internet | |
BuildArch: noarch | |
Requires: java-1.7.0-openjdk, java-1.7.0-openjdk-devel | |
%description | |
This is a RPM for bbs project. | |
%prep | |
%setup -q | |
%install | |
install -d $RPM_BUILD_ROOT/opt/apps | |
install -p $RPM_BUILD_DIR/%{name}-%{version}/%{name}.war $RPM_BUILD_ROOT/opt/apps/%{name}.war | |
%post | |
if [ -d "/usr/local/apache-tomcat-7.0.61/webapps" ]; then | |
mv /opt/apps/%{name}.war /usr/local/apache-tomcat-7.0.61/webapps | |
else | |
echo 'please install apache tomcat' | |
fi | |
%preun | |
rm -rf /usr/local/apache-tomcat-7.0.61/webapps/bbs | |
%postun | |
service tomcat restart | |
%files | |
%attr(644,root,root) /opt/apps/%{name}.war | |
%clean | |
rm -rf $RPM_BUILD_ROOT | |
%changelog | |
* Wed Apr 22 2015 Zhang Jinwen <jwzhang@thoughtworks.com> | |
- Build for CentOS-6.4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Several comments: