Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 201 lines (168 sloc) 6.473 kb
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
%if 0%(test -d .git && echo 1) == 1
%define commit %(git show | grep '^commit' | head -n 1 | sed 's/commit \\\(\.\.\.\.\.\.\.\\\)\.*/\\1/'|tr -d '\n')
%else
%define commit d73f142
%endif
%define git_suffix .git%{commit}

Name: @CMAKE_PROJECT_NAME@
Version: @VERSION@
Release: 4%{git_suffix}%{?dist}
Summary: PNL Waterfall Visualization Tool
Group: System Environment/Base
License: BSD with advertising
Source: https://github.com/EMSL-MSC/%{name}/tarball/%{commit}/EMSL-MSC-%{name}-%{commit}.tar.gz

URL: https://github.com/EMSL-MSC/%{name}
BuildRequires: ImageMagick-devel, mesa-libGL-devel, mesa-libGLU-devel,
BuildRequires: mesa-libOSMesa-devel, freeglut-devel, libgenders-devel,
BuildRequires: ftgl-devel, desktop-file-utils
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: shared-mime-info, desktop-file-utils, gtk2
%description
PNL Waterfall Visualization Tool for viewing performance data from
jobs on the Super Computers.

%package docs
Summary: PNL cview documentation
Group: System Environment/Libraries
License: BSD with advertising
BuildRequires: doxygen

%description docs
PNL cview doxygen generated documentation.

%package -n libcview
Summary: PNL common cview library
Group: System Environment/Libraries
License: BSD with advertising

%description -n libcview
PNL common library for cview packages

%package -n libcview-devel
Summary: PNL common cview library development files
Group: System Environment/Libraries
License: BSD with advertising
Requires: libcview%{?_isa} == %{version}-%{release}

%description -n libcview-devel
PNL development library and files for cview packages

%package -n libcview-data
Summary: PNL common cview data management library
Group: System Environment/Libraries
License: BSD with advertising

%description -n libcview-data
PNL common data management library for cview packages

%package -n libcview-data-devel
Summary: PNL common cview data management library development files
Group: System Environment/Libraries
License: BSD with advertising
Requires: libcview-data%{?_isa} == %{version}-%{release}

%description -n libcview-data-devel
PNL development data management library for cview packages

%package tests
Summary: PNL tests for cview internals
Group: System Environment/Libraries
License: BSD with advertising
Requires: cview%{?_isa} == %{version}-%{release}

%description tests
PNL tests for cview libraries and data sets.

%prep
%setup -q -n EMSL-MSC-%{name}-%{commit}

%build
%cmake .
%{__make} %{?_smp_mflags}
%{__make} doc

%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
rm -f %{buildroot}/%{_libdir}/*.la
rm -f %{buildroot}/%{_libdir}/*.a
# install tests to sharedir
mkdir -p "%{buildroot}/%{_datadir}/%{name}/tests"
cp tests/* "%{buildroot}/%{_datadir}/%{name}/tests"
mkdir -p "%{buildroot}/%{_datadir}/icons/hicolor/64x64/apps"
install -m 644 contrib/icon64.png "%{buildroot}/%{_datadir}/icons/hicolor/64x64/apps/application-x-cview.png"
install -m 644 contrib/icon64.png "%{buildroot}/%{_datadir}/icons/hicolor/64x64/apps/application-x-cviewall.png"
mkdir -p "%{buildroot}/%{_datadir}/icons/hicolor/64x64/mimetypes"
install -m 644 contrib/icon64.png "%{buildroot}/%{_datadir}/icons/hicolor/64x64/mimetypes/application-x-cview.png"
install -m 644 contrib/icon64.png "%{buildroot}/%{_datadir}/icons/hicolor/64x64/mimetypes/application-x-cviewall.png"
mkdir -p "%{buildroot}/%{_datadir}/%{name}/filetypes"
mkdir -p "%{buildroot}/%{_datadir}/mime/packages"
install -m 644 contrib/cview-mimetype.xml "%{buildroot}/%{_datadir}/mime/packages"
install -m 644 contrib/cviewall-mimetype.xml "%{buildroot}/%{_datadir}/mime/packages"
desktop-file-install \
    --dir=%{buildroot}%{_datadir}/applications \
    --vendor=cview \
    contrib/%{name}.desktop \
    contrib/%{name}all.desktop

%clean
rm -rf %{buildroot}

%post -n libcview -p /sbin/ldconfig
%postun -n libcview -p /sbin/ldconfig
%post -n libcview-data -p /sbin/ldconfig
%postun -n libcview-data -p /sbin/ldconfig

%post
update-mime-database /usr/share/mime
update-desktop-database

# This is a poor way, but for now I can't think of a better way to add these items into the defaults.list file
TMPFILE=`mktemp`
cat /usr/share/applications/defaults.list > $TMPFILE
grep -q 'application/x-cview=cview.desktop' || echo 'application/x-cview=cview.desktop' >> $TMPFILE
grep -q 'application/x-cviewall=cviewall.desktop' || echo 'application/x-cviewall=cviewall.desktop' >> $TMPFILE
sort $TMPFILE > /usr/share/applications/defaults.list
rm $TMPFILE
gtk-update-icon-cache /usr/share/icons/hicolor -f

%postun
update-mime-database /usr/share/mime
update-desktop-database

TMPFILE=`mktemp`
cat /usr/share/applications/defaults.list > $TMPFILE
grep -v -e '^application/x-cview=cview\.desktop$' -e '^application/x-cviewall=cviewall\.desktop$' $TMPFILE > /usr/share/applications/defaults.list
rm $TMPFILE
gtk-update-icon-cache /usr/share/icons/hicolor -f


%files
%defattr(-,root,root,-)
%doc README COPYING
%{_bindir}/cviewall
%{_mandir}/man1/cviewall.1.*
%{_bindir}/cview
%{_mandir}/man1/cview.1.*
%{_bindir}/oscview
%{_mandir}/man1/oscview.1.*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/applications/%{name}all.desktop
%{_datadir}/%{name}/*.svg
%{_datadir}/%{name}/*.ggr
%{_datadir}/mime/packages/cview-mimetype.xml
%{_datadir}/mime/packages/cviewall-mimetype.xml
%{_datadir}/icons/hicolor/64x64/apps/application-x-cview.png
%{_datadir}/icons/hicolor/64x64/apps/application-x-cviewall.png
%{_datadir}/icons/hicolor/64x64/mimetypes/application-x-cview.png
%{_datadir}/icons/hicolor/64x64/mimetypes/application-x-cviewall.png

%files tests
%defattr(-,root,root,-)
%doc README COPYING
%{_datadir}/%{name}/tests

%files docs
%defattr(0644,root,root,-)
%doc README COPYING
%doc docs/html/*

%files -n libcview
%defattr(-,root,root,-)
%doc README COPYING
%{_libdir}/libcview.so.0*
%{_datadir}/%{name}/*.ttf*

%files -n libcview-devel
%defattr(-,root,root,-)
%doc README COPYING
%{_libdir}/libcview.so
%{_libdir}/pkgconfig/cview.pc

%files -n libcview-data
%defattr(-,root,root,-)
%doc README COPYING
%{_libdir}/libcview-data.so.0*

%files -n libcview-data-devel
%defattr(-,root,root,-)
%doc README COPYING
%{_libdir}/libcview-data.so
%{_libdir}/pkgconfig/cview-data.pc
%{_includedir}/%{name}/*

%changelog
* Fri May 18 2012 David Brown <david.brown@pnnl.gov> - @VERSION@-4.gitaf101b5
- Updated build system to work with cmake

* Fri Apr 13 2012 David Brown <david.brown@pnnl.gov> - @VERSION@-1
- Initial Release
Something went wrong with that request. Please try again.