Java/JPackageSpecTemplate: различия между версиями

Материал из ALT Linux Wiki
(Import from freesource.info)
 
м (javadocdir заменён на _javadocdir)
 
(не показано 5 промежуточных версий 4 участников)
Строка 1: Строка 1:
[[Category:Policy]]
'''JPackage Spec Template'''
{{MovedFromFreesourceInfo|AltLinux/Policy/Java/JPackageSpecTemplate}}
 
JPackage Spec Template


Оригинальная версия живет тут [http://www.jpackage.org/template.spec spec]
Оригинальная версия живет тут [http://www.jpackage.org/template.spec spec]
<pre># Copyright (c) 2000-2007, JPackage Project
<pre># Copyright (c) 2000-2007, JPackage Project
# Adapted to ALT Linux
# All rights reserved.
# All rights reserved.
# TODO: menu entries
# TODO: shell scripts
# TODO: server stuff, init scripts etc
# if menu entries are created, define Summary here, and use it in the summary
# tag, and the menu entries' descriptions
%define javadir %{_datadir}/java
%define javadocdir %{_datadir}/javadoc
%define section # usually free
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------


Summary: # summary
Name: @PACKAGENAME@
Name: @PACKAGENAME@
Version: @VERSION@
Version: @VERSION@
Release: @RELEASE@
Release: @RELEASE@
Summary: # summary
License: # license
Group: # group, categories from freshmeat.net
Group: # group, categories from freshmeat.net
License: # license
 
URL: # homepage url, without rpm macros
URL: # homepage url, without rpm macros
Packager:
BuildArch: # usually noarch


BuildRequires: /proc
BuildArch: # usually noarch
Source0: # full url to source package, without rpm macros
Source0: # full url to source package, without rpm macros
# add patches, if any, here
# add patches, if any, here
BuildRequires: /proc rpm-build-java
# default java compiler
BuildRequires: java-devel-default
# to be able to run build-classpath, etc
BuildRequires: jpackage-utils


# build and runtime requirements here
# build and runtime requirements here
Строка 73: Строка 65:
%prep
%prep


%setup -q
%setup
# patches here
# patches here
# remove stuff we'll build, eg. jars, javadocs, extra sources here
# remove stuff we'll build, eg. jars, javadocs, extra sources here
Строка 93: Строка 85:


# javadoc
# javadoc
install -d $RPM_BUILD_ROOT%{javadocdir}/%{name}-%{version}/
install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/
# cp -pr javadocs to $RPM_BUILD_ROOT%{javadocdir}/%{name}-%{version}/
# cp -pr javadocs to $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/


# demo
# demo
Строка 111: Строка 103:
%files javadoc
%files javadoc
%defattr(0644,root,root,0755)
%defattr(0644,root,root,0755)
%{javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}-%{version}


%files demo
%files demo
Строка 121: Строка 113:
* Thu May 11 2006 Your Name <userid at domain.com> 0:1.0-1jpp
* Thu May 11 2006 Your Name <userid at domain.com> 0:1.0-1jpp
- First build</pre>
- First build</pre>
{{Category navigation|title=Java|category=Java|sortkey={{SUBPAGENAME}}}}
[[category:SampleSpecs]]

Текущая версия от 21:54, 7 декабря 2009

JPackage Spec Template

Оригинальная версия живет тут spec

# Copyright (c) 2000-2007, JPackage Project
# Adapted to ALT Linux
# All rights reserved.
# -----------------------------------------------------------------------------

Name: @PACKAGENAME@
Version: @VERSION@
Release: @RELEASE@

Summary: # summary
License: # license
Group: # group, categories from freshmeat.net

URL: # homepage url, without rpm macros
Packager: 
BuildArch: # usually noarch

Source0: # full url to source package, without rpm macros
# add patches, if any, here

BuildRequires: /proc rpm-build-java 
# default java compiler
BuildRequires: java-devel-default
# to be able to run build-classpath, etc
BuildRequires: jpackage-utils

# build and runtime requirements here

%description
# full package description

# -----------------------------------------------------------------------------

%package manual
Group: Documentation
Summary: Manual for %{name}

%description manual
Documentation for %{name}.

# -----------------------------------------------------------------------------

%package javadoc
Group: Documentation
Summary: Javadoc for %{name}

%description javadoc
Javadoc for %{name}.

# -----------------------------------------------------------------------------

%package demo
Group: # same as main package
Summary: Demos for %{name}
Requires: %{name} = %{version}-%{release}

%description demo
Demonstrations and samples for %{name}.

# -----------------------------------------------------------------------------

%prep

%setup
# patches here
# remove stuff we'll build, eg. jars, javadocs, extra sources here

# -----------------------------------------------------------------------------

%build
# yep

# -----------------------------------------------------------------------------

%install


# jar
install -d $RPM_BUILD_ROOT%{javadir}
# install jars to $RPM_BUILD_ROOT%{javadir}/ (as %{name}-%{version}.jar)
(cd $RPM_BUILD_ROOT%{javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)

# javadoc
install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/
# cp -pr javadocs to $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/

# demo
install -d $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}
# cp demos to $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/

%files
%defattr(0644,root,root,0755)
%doc # add docs here
%{javadir}/*

%files manual
%defattr(0644,root,root,0755)
%doc # add manual docs here

%files javadoc
%defattr(0644,root,root,0755)
%{_javadocdir}/%{name}-%{version}

%files demo
%defattr(0644,root,root,0755)
%{_datadir}/%{name}-%{version}


%changelog
* Thu May 11 2006 Your Name <userid at domain.com> 0:1.0-1jpp
- First build