%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Steps for making a new release
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
* get happy with the code
* choose new version
* update "Changes"
* make test release(s) to CPAN
* update manual.pdf
* make & upload tarball to CPAN
???* update links in install
* rebuild site
* release email
* Notify package maintainers (MacPorts, rpm, deb, Chocalatey,...)

#======================================================================
Get Happy
#======================================================================
obviously make, make test, re-run dlmf, check, etc.

#======================================================================
Choose new version
#======================================================================
# Last changes:
# * Adjust VERSION in LaTeXML.pm
# * add an entry to Changes
make
make test
doc/makemanual (pdf)
git commit -m "New release ..."
git push

# And tag the release:
git tag -a vX.X.X -m "Release X.X.X" <commitid>
git push --tags

#----------------------------------------------------------------------
# After preparing whatever tarballs & binaries you want:
doc/makesite
# to regenerate site w/current versions

#======================================================================
# update Changes
#======================================================================
# using the date of the last release:
git log --no-merges --name-status --since=<date>

grep log for lines starting "A" for new bindings

Hopefully have all issues labeled under the Milestone for the release
Scan closed issues under that Milestone

#======================================================================
Make Test relese to CPAN
#======================================================================
* See http://www.cpan.org/modules/04pause.html
* use a version number like:  0.8.1_1
* Log into https://pause.perl.org/

* watch cpantesters
http://www.cpantesters.org/distro/L/LaTeXML.html
#======================================================================
# Make the tarball
#======================================================================
make distclean
perl Makefile.PL
make dist

* check the tarball with clamscans

# We now have LaTeXML-x.x.x.tar.gz
# Copy to <site>/releases

#======================================================================
# Contact Maintainers
#======================================================================

MacPorts: Me!
RedHat/etc rpms: W. Mikail Petullo <mike@flyn.org> (?)
debian:  Norbert Preining <preining@logic.at>
  Thanks: Peter Ralph <petrel.harp@gmail.com>,
          Atsuhito Kohda <kohda@pm.tokushima-u.ac.jp>
Chocolatey: Ronald Tse <tse@ribose.com>


#======================================================================
# Make MacPorts Portfile for MacOS
#======================================================================
# Maintainer: adfernandes@?  but appears to have quit?
# Latest was checked in by mojca@...

 * Modify ~/Macports/tex/LaTeXML/Portfile
  - Change version number
  - recompute checksums
    (use port -v install and it suggests checksums for you to cut'n'paste!)
    (Be careful of cached tarballs: use port clean --all)
  - Test Portfile; PR requirements:
    sudo port lint LaTeXML
    sudo port test LaTeXML
    sudo port -vst install LaTeXML
    test basic functionality

 * copy resulting Portfile as <site>/releases/Portfile-<version>
 
 * Create PR
   - Use my fork of brucemiller/macports-ports
   - sync it to macports/macports-ports
     git checkout master
     git fetch upstream master
     git rebase upstream/master
     git push
   - create branch, 
     git branch LaTeXML-X.Y.Z
     git checkout LaTeXML-X.Y.Z  
     cp ~/Macports/tex/LaTeXML/Portfile ~/macports-ports/tex/LaTeXML
     git status/git diff/etc
     git commit -m "LaTeXML: update to upstream version X.Y.Z" tex/LaTeXML/Portfile
     git push origin latexml-X.Y.Z
     (sometimes using --force, if you've mangled a previous try :> )

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Random Extra Details
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

#======================================================================
About Version Numbers
#======================================================================
There's loads of contradictory advice for Perl version numbers out there!
I insist on "dotted-decimal" version numbers ie. 1.2.3
So then, the seemingly recommended form to use is:
  use version; our $VERSION = version->declare("v1.2.3");
However, then "make dist" leads to the UGLY
  module-v1.2.3-tar.gz
So, hopefully, I can get away with:
  use version; our $VERSION = version->declare("1.2.3");

#======================================================================
# Make RPM's
#======================================================================
# * Possibly make LaTeXML.spec (see below)
#   Edit LaTeXML.spec for current version
# * Make the source rpm:
#   cp is important, otherwise it will reuse your old one!

cp LaTeXML-x.x.x.tar.gz ~/rpmbuild/SOURCES/
 rpmbuild -bs LaTeXML.spec

#   this creates ~/rpmbuild/SRPMS/LaTeXML-X.X.X-1.fcXX.src.rpm
# * Use mock to create & test the rpm
# * make sure you're in the mock group

mock --rebuild ~/rpmbuild/SRPMS/LaTeXML-X.X.X-1.fcXX.src.rpm

# Copy the rpms to <site>/releases

#======================================================================
# Scan tarballs, rpms, etc using ClamAV
clamscan  --tempdir=/dev/shm --recursive  --max-recursion=128 --cross-fs=no  --infected  --block-encrypted=yes --max-files=123456789  --max-filesize=4000M  --max-scansize=4000M sometarball

#======================================================================
