From 8ddc2fc79a45283e7b90f59e9a7763e877d4c044 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 16 Aug 2022 16:27:31 -0700 Subject: Integrate server into main pandoc. - Remove server flag. - Remove pandoc-server executable. - Add Text.Pandoc.Server as exposed module. [API change] - Re-use Opt (and our existing FromJSON instance) for Params. - Document. --- linux/control.in | 30 ++++++++++++++++++++++++ linux/make_artifacts.sh | 52 +++++++++++++++++++++++------------------- linux/pandoc-server.control.in | 9 -------- linux/pandoc.control.in | 30 ------------------------ 4 files changed, 58 insertions(+), 63 deletions(-) create mode 100644 linux/control.in delete mode 100644 linux/pandoc-server.control.in delete mode 100644 linux/pandoc.control.in (limited to 'linux') diff --git a/linux/control.in b/linux/control.in new file mode 100644 index 000000000..51a683629 --- /dev/null +++ b/linux/control.in @@ -0,0 +1,30 @@ +Package: pandoc +Version: VERSION +Section: text +Priority: optional +Architecture: ARCHITECTURE +Installed-Size: INSTALLED_SIZE +Depends: libc6 (>= 2.13), libgmp10, zlib1g (>= 1:1.1.4) +Replaces: pandoc-data +Suggests: texlive-latex-recommended, texlive-xetex, + texlive-fonts-recommended +Maintainer: John MacFarlane +Description: general markup converter + Pandoc is a Haskell library for converting from one markup format + to another, and a command-line tool that uses this library. The + formats it can handle include light markup formats (many variants + of Markdown, reStructuredText, AsciiDoc, Org-mode, Muse, Textile, + txt2tags), HTML formats (HTML 4 and 5), ebook formats (EPUB v2 + and v3, FB2), Documentation formats (GNU TexInfo, Haddock), + Roff formats (man, ms), TeX formats (LaTeX, ConTeXt), XML + formats (DocBook 4 and 5, JATS, TEI Simple, OpenDocument), + outline formats (OPML), bibliography formats (BibTeX, BibLaTeX, + CSL JSON, CSL YAML, RIS), word processor formats (Docx, RTF, + ODT), interactive notebook formats (Jupyter notebook + ipynb), page layout formats (InDesign ICML), wiki markup + formats (MediaWiki, DokuWiki, TikiWiki, TWiki, Vimwiki, + XWiki, ZimWiki, Jira wiki, Creole), slide show formats + (LaTeX Beamer, PowerPoint, Slidy, reveal.js, Slideous, S5, + DZSlides), data formats (CSV and TSV tables), and PDF (via + external programs such as pdflatex or wkhtmltopdf). + diff --git a/linux/make_artifacts.sh b/linux/make_artifacts.sh index 5e594b569..4653a0c19 100644 --- a/linux/make_artifacts.sh +++ b/linux/make_artifacts.sh @@ -27,42 +27,44 @@ ghc --version cabal update cabal clean -cabal configure -fserver -f-export-dynamic -fembed_data_files --enable-executable-static --ghc-options '-j4 +RTS -A256m -RTS -split-sections -optc-Os -optl=-pthread' pandoc pandoc-server +cabal configure -f-export-dynamic -fembed_data_files --enable-executable-static --ghc-options '-j4 +RTS -A256m -RTS -split-sections -optc-Os -optl=-pthread' pandoc cabal build -j4 for f in $(find dist-newstyle -name 'pandoc' -type f -perm /400); do cp $f $ARTIFACTS/; done -for f in $(find dist-newstyle -name 'pandoc-server' -type f -perm /400); do cp $f /$ARTIFACTS/; done # Confirm that we have static builds file $ARTIFACTS/pandoc | grep "statically linked" -file $ARTIFACTS/pandoc-server | grep "statically linked" -# make deb for EXE make_deb() { - VERSION=`$ARTIFACTS/$EXE --version | awk '{print $2; exit;}'` + VERSION=`$ARTIFACTS/pandoc --version | awk '{print $2; exit;}'` REVISION=${REVISION:-1} DEBVER=$VERSION-$REVISION - BASE=$EXE-$DEBVER-$ARCHITECTURE + BASE=pandoc-$DEBVER-$ARCHITECTURE DIST=/mnt/$BASE DEST=$DIST/usr - COPYRIGHT=$DEST/share/doc/$EXE/copyright + COPYRIGHT=$DEST/share/doc/pandoc/copyright cd /mnt mkdir -p $DEST/bin mkdir -p $DEST/share/man/man1 - mkdir -p $DEST/share/doc/$EXE + mkdir -p $DEST/share/doc/pandoc find $DIST -type d | xargs chmod 755 - cp $ARTIFACTS/$EXE $DEST/bin/ - strip $DEST/bin/$EXE - cp /mnt/man/$EXE.1 $DEST/share/man/man1/$EXE.1 - gzip -9 $DEST/share/man/man1/$EXE.1 + cp $ARTIFACTS/pandoc $DEST/bin/ + cd $DEST/bin + strip pandoc + ln -s pandoc pandoc-server + cd /mnt + cp /mnt/man/pandoc.1 $DEST/share/man/man1/pandoc.1 + gzip -9 $DEST/share/man/man1/pandoc.1 + cp /mnt/man/pandoc-server.1 $DEST/share/man/man1/pandoc-server.1 + gzip -9 $DEST/share/man/man1/pandoc-server.1 cp /mnt/COPYRIGHT $COPYRIGHT echo "" >> $COPYRIGHT INSTALLED_SIZE=$(du -k -s $DEST | awk '{print $1}') mkdir $DIST/DEBIAN - perl -pe "s/VERSION/$DEBVER/" /mnt/linux/$EXE.control.in | \ + perl -pe "s/VERSION/$DEBVER/" /mnt/linux/control.in | \ perl -pe "s/ARCHITECTURE/$ARCHITECTURE/" | \ perl -pe "s/INSTALLED_SIZE/$INSTALLED_SIZE/" \ > $DIST/DEBIAN/control @@ -73,26 +75,28 @@ make_deb() { cp $BASE.deb $ARTIFACTS/ } -# Make tarball for EXE +# Make tarball for pandoc make_tarball() { - TARGET=$EXE-$VERSION + TARGET=pandoc-$VERSION cd $ARTIFACTS rm -rf $TARGET mkdir $TARGET mkdir $TARGET/bin $TARGET/share $TARGET/share/man $TARGET/share/man/man1 - cp /mnt/man/$EXE.1 $TARGET/share/man/man1 - mv $EXE $TARGET/bin - strip $TARGET/bin/$EXE - gzip -9 $TARGET/share/man/man1/$EXE.1 + cp /mnt/man/pandoc.1 $TARGET/share/man/man1 + cp /mnt/man/pandoc-server.1 $TARGET/share/man/man1 + mv pandoc $TARGET/bin + cd $TARGET/bin + strip pandoc + ln -s pandoc pandoc-server + cd $ARTIFACTS + gzip -9 $TARGET/share/man/man1/pandoc.1 + gzip -9 $TARGET/share/man/man1/pandoc-server.1 tar cvzf $TARGET-linux-$ARCHITECTURE.tar.gz $TARGET rm -r $TARGET } -for EXE in pandoc pandoc-server -do - make_deb - make_tarball -done +make_deb +make_tarball exit 0 diff --git a/linux/pandoc-server.control.in b/linux/pandoc-server.control.in deleted file mode 100644 index 348fd21c4..000000000 --- a/linux/pandoc-server.control.in +++ /dev/null @@ -1,9 +0,0 @@ -Package: pandoc-server -Version: VERSION -Section: text -Priority: optional -Architecture: ARCHITECTURE -Installed-Size: INSTALLED_SIZE -Depends: libc6 (>= 2.13), libgmp10, zlib1g (>= 1:1.1.4) -Maintainer: John MacFarlane -Description: HTTP server for pandoc document format converter diff --git a/linux/pandoc.control.in b/linux/pandoc.control.in deleted file mode 100644 index 51a683629..000000000 --- a/linux/pandoc.control.in +++ /dev/null @@ -1,30 +0,0 @@ -Package: pandoc -Version: VERSION -Section: text -Priority: optional -Architecture: ARCHITECTURE -Installed-Size: INSTALLED_SIZE -Depends: libc6 (>= 2.13), libgmp10, zlib1g (>= 1:1.1.4) -Replaces: pandoc-data -Suggests: texlive-latex-recommended, texlive-xetex, - texlive-fonts-recommended -Maintainer: John MacFarlane -Description: general markup converter - Pandoc is a Haskell library for converting from one markup format - to another, and a command-line tool that uses this library. The - formats it can handle include light markup formats (many variants - of Markdown, reStructuredText, AsciiDoc, Org-mode, Muse, Textile, - txt2tags), HTML formats (HTML 4 and 5), ebook formats (EPUB v2 - and v3, FB2), Documentation formats (GNU TexInfo, Haddock), - Roff formats (man, ms), TeX formats (LaTeX, ConTeXt), XML - formats (DocBook 4 and 5, JATS, TEI Simple, OpenDocument), - outline formats (OPML), bibliography formats (BibTeX, BibLaTeX, - CSL JSON, CSL YAML, RIS), word processor formats (Docx, RTF, - ODT), interactive notebook formats (Jupyter notebook - ipynb), page layout formats (InDesign ICML), wiki markup - formats (MediaWiki, DokuWiki, TikiWiki, TWiki, Vimwiki, - XWiki, ZimWiki, Jira wiki, Creole), slide show formats - (LaTeX Beamer, PowerPoint, Slidy, reveal.js, Slideous, S5, - DZSlides), data formats (CSV and TSV tables), and PDF (via - external programs such as pdflatex or wkhtmltopdf). - -- cgit v1.2.3