Package Details: msieve 1.54r1034-2

Git Clone URL: (read-only, click to copy)
Package Base: msieve
Description: Library for factoring large integers
Upstream URL:
Licenses: custom
Submitter: vesath
Maintainer: None
Last Packager: vesath
Votes: 13
Popularity: 0.000000
First Submitted: 2011-10-25 06:17
Last Updated: 2020-09-28 22:40

Latest Comments

vesath commented on 2020-10-05 08:29

ccorn: That's a great suggestion but since I lack the time and interest to work on this package I've just orphaned it so you can adopt it and become its new maintainer. Cheers.

ccorn commented on 2020-10-04 01:33

Since Sourceforge does not seem to support reproducible snapshot archives, it is probably best to use subversion directly. This also reduces the transfer costs of updates and eliminates the need to patch Makefile for SVN_VERSION.

Some more tweaks. My commit message reads:

Use svn; make package optionally auto-updatable; further tweaks.

To avoid having to host sources separately, use subversion directly.
This maintains a persistent svn checkout, thus reduces update size.

_pkgrev specifies the SVN revision to use.
Unset means the latest.
pkgver is automatically set accordingly.
Depending on whether _pkgrev is set or not,
pkgname becomes msieve or msieve-svn.
The -svn package also declares that it provides,
and conflicts with, the non-svn variant.
The built executable keeps the name "msieve" in both variants.

Also install more documentation files.

No longer patch Makefile. It knows to run `svnversion .`,
but that would append "M" to the revision number if any changes
to the checkout are detected. To tweak CFLAGS, use MACHINE_FLAGS.

Note: This means that our CFLAGS now follow the Makefile's
OPT_FLAGS instead of preceding them. Therefore, unless we
explicitly filter out -O and -m flags, we override their
counterparts from OPT_FLAGS.

I'll post the PKGBUILD here directly because that's shorter than the diff:

# Maintainer: Gaetan Bisson <>

# Set _pkgrev to a revision number in order to fix the version.
# Leaving _pkgrev empty or undefined makes a latest-version *-svn package.

if [ -z "${_pkgrev}" ]; then
# pkgver gets auto-updated (but to the version determined by _pkgrev if given)
pkgdesc='Library for factoring large integers'
depends=('zlib' 'gmp-ecm')

prepare() {
    cd "${srcdir}/${_prjname}"
    if test -n "${_pkgrev}"; then svn update -r "${_pkgrev}"; fi

# Find line(s) beginning with "#define $1 " in file $2 and output the remainder
_get_def() {
    local s="[[:space:]]"
    sed -n -E "s/^$s*#$s*define$s+$1$s+//p" "$2"

pkgver() {
    cd "${srcdir}/${_prjname}"
    MAJOR_VERSION=$(_get_def MSIEVE_MAJOR_VERSION include/msieve.h)
    MINOR_VERSION=$(_get_def MSIEVE_MINOR_VERSION include/msieve.h)
    # Note: if you modify the checkout, svnversion will append "M"
    SVN_VERSION=$(svnversion .)
    printf '%d.%02dr%s\n' "$MAJOR_VERSION" "$MINOR_VERSION" "$SVN_VERSION"

build() {
    cd "${srcdir}/${_prjname}"
    CFLAGS+=' -fopenmp'
    # Note: Makefile defines auto-configured OPT_FLAGS
    # and leaves MACHINE_FLAGS for us to tweak CFLAGS.
    # (a) If you do not want to override OPT_FLAGS's -O3 or -march=native:
    # make all ECM=1 MACHINE_FLAGS="\$(filter-out -O% -m%,$CFLAGS)"
    # (b) Better keep our -m overrides, but use OPT_FLAGS's -O3 setting:
    # make all ECM=1 MACHINE_FLAGS="\$(filter-out -O%,$CFLAGS)"
    # (c) Use all CFLAGS from makepkg.conf, including -O* and -m* flags:
    make all ECM=1 MACHINE_FLAGS="$CFLAGS"

package() {
    cd "${srcdir}/${_prjname}"
    install -Dm755 msieve "${pkgdir}"/usr/bin/msieve
    install -Dm644 -t "${pkgdir}/usr/share/doc/${pkgname}" Changes Readme*
    install -d "${pkgdir}/usr/share/licenses/${pkgname}"
    ln -s /usr/share/doc/${pkgname}/Readme "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

vesath commented on 2020-09-28 22:28

hotaru: Thanks for noticig. I guess you need to click on the sourceforge website UI to trigger the zip file generation and then the URL remains valid for about an hour. I'll host a copy on my server and update the PKGBUILD. Cheers.

hotaru commented on 2020-09-28 17:41 is giving a 404 error.

vesath commented on 2020-09-28 06:19

Great work! Thanks a lot.

However that sha256sums did not work for me. I'm guessing sourceforge generates the zip file on demand and only caches it for a couple of hours. That's annoying. I don't want to use 'SKIP' as checksum and I don't feel like hosting a static copy of the zip file myself. Hopefully Jason will release a new msieve soon... :-)

ccorn commented on 2020-09-27 18:44

Version update (necessary with GMP v6.2) and minor tweaks:

@@ -1,32 +1,36 @@
 # Maintainer: Gaetan Bisson <>

 pkgdesc='Library for factoring large integers'
 depends=('zlib' 'gmp-ecm')

 prepare() {
-   cd "${srcdir}/${pkgname}-${pkgver}"
+   cd "${srcdir}/${pkgname}-${_srcrev}"
    sed \
        -e 's/^CFLAGS =/CFLAGS +=/' \
+       -e "/^SVN_VERSION :=/s/=.*/= r${_pkgrev}/" \
        -i Makefile

 build() {
-   cd "${srcdir}/${pkgname}-${pkgver}"
+   cd "${srcdir}/${pkgname}-${_srcrev}"
    CFLAGS+=' -fopenmp'
    make all ECM=1

 package() {
-   cd "${srcdir}/${pkgname}-${pkgver}"
+   cd "${srcdir}/${pkgname}-${_srcrev}"
    install -Dm755 msieve "${pkgdir}"/usr/bin/msieve
-   install -Dm544 Readme "${pkgdir}"/usr/share/doc/msieve/Readme
-   install -d "${pkgdir}"/usr/share/licenses/msieve; ln -s /usr/share/doc/msieve/Readme "${pkgdir}"/usr/share/licenses/msieve/Readme
+   install -Dm644 Readme "${pkgdir}"/usr/share/doc/msieve/Readme
+   install -d "${pkgdir}"/usr/share/licenses/msieve
+   ln -s /usr/share/doc/msieve/Readme "${pkgdir}"/usr/share/licenses/msieve/LICENSE