# generated by cabal-rpm-0.12.4 # https://fedoraproject.org/wiki/Packaging:Haskell %global pkg_name gitit %global pkgver %{pkg_name}-%{version} # We package this against a snapshot, in order to build against newer pandoc. # The last release of gitit only works against pandoc 1.x. # The version in git works against pandoc 2.2, so I needed some minor cleanup # to build against the version of pandoc in Fedora as of this writing (2.1). %global commit ee9927f8c22bc76353aa8589220b6aafc343847c %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: %{pkg_name} Version: 0.12.2.1 Release: 2.20180816git%{shortcommit}%{?dist} Summary: Wiki using happstack, git or darcs, and pandoc # Main package is under GPLv2 # jquery: MIT # Bluetrip: MIT or GPLv2 # YUI: BSD # TANGOICONS: CC-BY-SA License: GPLv2 and MIT and BSD and CC-BY-SA and (MIT or GPLv2) Url: https://hackage.haskell.org/package/%{pkg_name} Source0: https://github.com/jgm/gitit/archive/%{commit}/%{name}-%{shortcommit}.tar.gz # Configuration produced by running the following command: # $ gitit --print-default-config > gitit.conf # Unfortunately, I don't know if it's easy to do this *inside* the package. Source1: gitit.conf # Systemd service file for gitit. Source2: gitit.service # Fix build with pandoc < 2.2. Patch0: gitit-older-pandoc.patch # Bundled provides for some JS and CSS. Provides: bundled(js-jquery) = 1.2.6 Provides: bundled(js-jquery-ui) = 1.6rc2 Provides: bundled(js-jquery-hotkeys) = 0.7.9 Provides: bundled(js-yui2) = 2.7.0 # I couldn't find any version information for bluetrip or tango icons. Provides: bundled(bluetrip) Provides: bundled(tango-icon-theme) # We install a systemd service file. BuildRequires: systemd # Want to create a user for gitit. Requires(pre): shadow-utils BuildRequires: ghc-Cabal-devel BuildRequires: ghc-rpm-macros # Begin cabal-rpm deps: BuildRequires: chrpath BuildRequires: ghc-ConfigFile-devel BuildRequires: ghc-HStringTemplate-devel BuildRequires: ghc-HTTP-devel BuildRequires: ghc-SHA-devel BuildRequires: ghc-aeson-devel BuildRequires: ghc-base64-bytestring-devel BuildRequires: ghc-blaze-html-devel BuildRequires: ghc-bytestring-devel BuildRequires: ghc-containers-devel BuildRequires: ghc-directory-devel BuildRequires: ghc-feed-devel BuildRequires: ghc-filepath-devel BuildRequires: ghc-filestore-devel BuildRequires: ghc-ghc-devel BuildRequires: ghc-ghc-paths-devel BuildRequires: ghc-happstack-server-devel BuildRequires: ghc-highlighting-kate-devel BuildRequires: ghc-hoauth2-devel BuildRequires: ghc-hslogger-devel BuildRequires: ghc-http-client-tls-devel BuildRequires: ghc-http-conduit-devel BuildRequires: ghc-json-devel BuildRequires: ghc-mtl-devel BuildRequires: ghc-network-devel BuildRequires: ghc-network-uri-devel BuildRequires: ghc-old-locale-devel BuildRequires: ghc-old-time-devel BuildRequires: ghc-pandoc-devel BuildRequires: ghc-pandoc-types-devel BuildRequires: ghc-parsec-devel BuildRequires: ghc-pretty-devel BuildRequires: ghc-process-devel BuildRequires: ghc-random-devel BuildRequires: ghc-recaptcha-devel BuildRequires: ghc-safe-devel BuildRequires: ghc-split-devel BuildRequires: ghc-syb-devel BuildRequires: ghc-tagsoup-devel BuildRequires: ghc-text-devel BuildRequires: ghc-time-devel BuildRequires: ghc-uri-devel BuildRequires: ghc-url-devel BuildRequires: ghc-utf8-string-devel BuildRequires: ghc-uuid-devel BuildRequires: ghc-xhtml-devel BuildRequires: ghc-xml-devel BuildRequires: ghc-xss-sanitize-devel BuildRequires: ghc-zlib-devel # End cabal-rpm deps %description Gitit is a wiki backed by a git, darcs, or mercurial filestore. Pages and uploaded files can be modified either directly via the VCS's command-line tools or through the wiki's web interface. Pandoc is used for markup processing, so pages may be written in (extended) markdown, reStructuredText, LaTeX, HTML, or literate Haskell, and exported in ten different formats, including LaTeX, ConTeXt, DocBook, RTF, OpenOffice ODT, and MediaWiki markup. Notable features include * plugins: dynamically loaded page transformations written in Haskell (see "Network.Gitit.Interface") * conversion of TeX math to MathML for display in web browsers * syntax highlighting of source code files and code snippets * Atom feeds (site-wide and per-page) * a library, "Network.Gitit", that makes it simple to include a gitit wiki in any happstack application You can see a running demo at . For usage information: 'gitit --help'. %package devel Summary: Haskell %{pkg_name} library development files Provides: %{name}-static = %{version}-%{release} Provides: %{name}-doc = %{version}-%{release} %if %{defined ghc_version} Requires: ghc-compiler = %{ghc_version} Requires(post): ghc-compiler = %{ghc_version} Requires(postun): ghc-compiler = %{ghc_version} %endif Requires: %{name}%{?_isa} = %{version}-%{release} %description devel This package provides the Haskell %{pkg_name} library development files. %prep %autosetup -n %{name}-%{commit} -p1 cabal-tweak-dep-ver pandoc-types 1.17.4.2 1.15 cabal-tweak-dep-ver pandoc 2.2 2.0 cabal-tweak-dep-ver skylighting 0.5.1 0.4.1 %build %ghc_lib_build %install %ghc_lib_install %ghc_fix_rpath %{pkgver} # We need these for the software to work! #rm %{buildroot}%{_datadir}/%{pkgver}/{CHANGES,README.markdown} # Install configuration file. mkdir -p %{buildroot}%{_sysconfdir}/gitit cp -a %SOURCE1 %{buildroot}%{_sysconfdir}/gitit/ # Install systemd service file. mkdir -p %{buildroot}%{_unitdir} cp -a %SOURCE2 %{buildroot}%{_unitdir} # Install home directory for gitit user. # We need some structure here (a "wiki" subdir, for the actual contents) # which is why it's created in the package. mkdir -p %{buildroot}%{_sharedstatedir}/gitit/wiki %pre getent group gitit >/dev/null || groupadd -r gitit getent passwd gitit >/dev/null || \ useradd -r -g gitit -d %{_sharedstatedir}/gitit -s /sbin/nologin \ -c "Account for gitit wiki service" gitit exit 0 %post %systemd_post gitit.service %preun %systemd_preun gitit.service %postun %systemd_postun_with_restart gitit.service %post devel %ghc_pkg_recache %postun devel %ghc_pkg_recache %files -f ghc-%{name}.files %license LICENSE BLUETRIP-LICENSE YUI-LICENSE TANGOICONS %{_datadir}/%{pkgver} %{_bindir}/expireGititCache %{_bindir}/%{pkg_name} %{_unitdir}/gitit.service %config(noreplace) %{_sysconfdir}/gitit %doc CHANGES README.markdown # We want to install /var/lib/gitit/wiki and make it owned by the # gitit user created in %pre... I forget if this is the best way to do that. # (I guess the alternative is to try and make the directories in %post). %attr(-,gitit,gitit) %dir %{_sharedstatedir}/gitit/ %attr(-,gitit,gitit) %dir %{_sharedstatedir}/gitit/wiki/ %files devel -f ghc-%{name}-devel.files %changelog * Fri Sep 28 2018 Ben Rosser - 0.12.2.1-2.20180816gitee9927f - Updated license tag, add extra license files to package. - Mark the entire /etc/gitit directory as owned by this package. - Add bundled provides for javascript, CSS, and icons. * Thu Aug 16 2018 Fedora Haskell SIG - 0.12.2.1-1.20180816gitee9927f - spec file generated by cabal-rpm-0.12.4