all: libpsplot.so libpsplot.a
psplot.o: psplot.txt
- ${F77} -x f77 psplot.txt -c ${CFLAGS}
+ $(F77) -x f77 psplot.txt -c $(CFLAGS) -fPIC
libpsplot.so: psplot.o
- ${F77} --shared psplot.o ${CFLAGS} -o libpsplot.so
+ $(F77) $(LDFLAGS) -shared -Wl,-soname,libpsplot.so.0 psplot.o $(CFLAGS) -o libpsplot.so.0
+ ln -sf libpsplot.so.0 libpsplot.so
libpsplot.a: psplot.o
- ${AR} r libpsplot.a psplot.o
- ${RANLIB} libpsplot.a
+ $(AR) r libpsplot.a psplot.o
+ $(RANLIB) libpsplot.a
--- /dev/null
+--- psplot/psplot.txt.orig 2001-08-10 16:12:09.000000000 +0200
++++ psplot/psplot.txt 2013-03-06 20:50:24.569471004 +0100
+@@ -7439,6 +7439,7 @@
+ character*132 cmdstr,curfnt
+ character*80 fileout
+ character tim*8,dat*9
++ character zone*5
+ character*1 timer(8),dater(9)
+ equivalence(timer(1),tim),(dater(1),dat)
+ common/conre1/ioffp,spval
+@@ -7493,8 +7494,7 @@
+ cmdstr= '%%Title: '//fileout(1:lenstr(fileout,80))
+
+ call filler
+- call time(tim)
+- call date(dat)
++ call date_and_time(dat, tim, zone)
+ if(timer(1).eq.' ')timer(1)='0'
+ if(dater(1).eq.' ')dater(1)='0'
+ cmdstr= '%%CreationDate: '//DAT//' '//TIM
Source0: ftp://student.ifpan.edu.pl/pub/psplot/%{name}-%{version}.tar.gz
# Source0-md5: 3704836929eae06c9419b339d6e4c5c4
Source1: %{name}-Makefile
+Patch0: %{name}-gfortran.patch
URL: http://www.nova.edu/cwis/oceanography/psplot.html
-BuildRequires: gcc-g77
+BuildRequires: gcc-fortran
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
współdzieloną.
%package devel
-Summary: A Fortran-callable Postscript plotting library - header files
-Summary(pl.UTF-8): Pliki nagłówkowe do działającej z Fortranem biblioteki rysującej Postscript
+Summary: A Fortran-callable Postscript plotting library - development files
+Summary(pl.UTF-8): Pliki programistyczne działającej z Fortranem biblioteki rysującej Postscript
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
-Header files for the psplot library.
+Development files for the psplot library.
%description devel -l pl.UTF-8
-Pliki nagłówkowe do biblioteki psplot.
+Pliki programistyczne biblioteki psplot.
+
+%package static
+Summary: Static psplot library
+Summary(pl.UTF-8): Statyczna biblioteka psplot
+Group: Development/Libraries
+Requires: %{name}-devel = %{version}-%{release}
+
+%description static
+Static psplot library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka psplot.
%prep
%setup -q -n %{name}
+%patch0 -p1
-%build
cp -f %{SOURCE1} Makefile
-%{__make} "CFLAGS=%{rpmcflags}"
+%build
+%{__make} \
+ F77=%{_target_alias}-gfortran \
+ CFLAGS="%{rpmcflags}" \
+ LDFLAGS="%{rpmldflags}"
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_libdir}
-install libpsplot.so $RPM_BUILD_ROOT%{_libdir}
+
+cp -dp libpsplot.so* $RPM_BUILD_ROOT%{_libdir}
install libpsplot.a $RPM_BUILD_ROOT%{_libdir}
%clean
%files
%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/lib%{name}.so
+%doc readme.txt release_notes.txt
+%attr(755,root,root) %{_libdir}/libpsplot.so.0
%files devel
%defattr(644,root,root,755)
-%doc grmana4.ps *.txt *.for
-%{_libdir}/lib%{name}.a
+%doc grmana4.ps *.for
+%attr(755,root,root) %{_libdir}/libpsplot.so
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libpsplot.a