LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File cmion-main.spec of Package cmion-main (Project home:inescid:robots)

Name:           cmion-main
Version:        0.0.201309221742
Release:        1
Summary:        cmion (main)
License:        GPL
URL:            http://fatima-modular.sourceforge.net/
Source:         %{name}-%{version}.tar.gz
BuildRequires:  ant
BuildRequires:  xmlenc ion-meta ion-core ion-sync-collections
Group:          Development/Languages/Java
Vendor:         INESC ID Lisboa
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Requires:  	xmlenc ion-meta ion-core ion-sync-collections

%description
cmion (main)

%package        javadoc
Summary:        Javadoc for %{name}
Group:          Development/Languages/Java
Requires(post): %{__rm}
Requires(post): /bin/ln
Requires(postun): %{__rm}

%description    javadoc
Javadoc for %{name}.


%package  lirec
License:        GPL-3.0
Group:          Productivity/Scientific/Other
Summary:        cmion-main-lirec

%description lirec
cmion-main-lirec (level 2 and 3) 

%prep
%setup

# remove all the stuff we'll build ourselves
find . \( -name "*.jar" -o -name "*.class" \) -exec %__rm -f {} \;

%build
%ant -Dversion.major=%{version} -Dversion.minor=0 all

%install
%__rm -rf %{buildroot}

# jars
%__mkdir_p %{buildroot}%{_javadir}
%__cp -a build/%{name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed  "s|-%{version}||g"`; done)

# javadoc
%__mkdir_p %{buildroot}%{_javadocdir}/%{name}-%{version}
%__cp -a build/javadoc/* %{buildroot}%{_javadocdir}/%{name}-%{version}
(cd %{buildroot}%{_javadocdir} && %__ln_s %{name}-%{version} %{name})

%__mkdir_p %{buildroot}%{_datadir}
%__cp -a ./src/cmion/* %{buildroot}%{_datadir}
%__cp -a ./cmion.doc %{buildroot}%{_datadir}


#files 
cd $RPM_BUILD_ROOT
find .%{_javadir} -print | sed 's,^\.,\%attr(-\,root\,root) ,'  > $RPM_BUILD_DIR/files.list
find .%{_datadir}/architecture -print | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/files.list
echo .%{_datadir}/cmion.doc | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/files.list
find .%{_datadir}/storage -print|  sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/files.list
find .%{_datadir}/util -print|  sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/files.list
find .%{_datadir}/level2 -print|  sed 's,^\.,\%attr(-\,root\,root) ,' > $RPM_BUILD_DIR/files-lirec.list
find .%{_datadir}/level3 -print|  sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/files-lirec.list

%clean
%__rm -rf %{buildroot}

%post

%postun

%post javadoc
%__rm -f %{_javadocdir}/%{name}
%__ln_s %{name}-%{version} %{_javadocdir}/%{name}

%postun javadoc
if [ $1 -eq 0 ]; then
  %__rm -f %{_javadocdir}/%{name}
fi

%files -f ../files.list
%defattr(-,root,root,-)
%{_javadir}/*

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

%files lirec -f ../files-lirec.list
%defattr(-,root,root,-)