--- /dev/null
+cmake_minimum_required(VERSION 3.5)
+
+SET (private_mod_path "${CMAKE_SOURCE_DIR}/cmake")
+LIST (APPEND CMAKE_MODULE_PATH "${private_mod_path}")
+INCLUDE(Shlomif_Common)
+
+SHLOMIF_COMMON_SETUP("${private_mod_path}")
+
+CMAKE_POLICY(SET CMP0054 NEW)
+
+SET (PKGDATADIR_SUBDIR "fortune-mod")
+SET (RELATIVE_PKGDATADIR "${RELATIVE_DATADIR}/${PKGDATADIR_SUBDIR}")
+SET (PKGDATADIR "${DATADIR}/${PKGDATADIR_SUBDIR}")
+
+# Introduces VERSION , CPACK_PACKAGE_VERSION_MAJOR,
+# CPACK_PACKAGE_VERSION_MAJOR, and CPACK_PACKAGE_VERSION_PATCH
+READ_VERSION_FROM_VER_TXT()
+
+# This is the equivalent to perform a "make dist"/"make distdir" etc.
+SET(CPACK_PACKAGE_NAME "fortune-mod")
+SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "fortune-mod")
+SET(CPACK_PACKAGE_VENDOR "Shlomi Fish")
+SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
+SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.txt")
+
+
+SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_DESCRIPTION_SUMMARY} ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+
+SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+
+SET (base_with_ver "fortune-mod-[0-9]+\\\\.[0-9]+\\\\.[0-9]+")
+
+SET(CPACK_SOURCE_IGNORE_FILES
+ "/.deps/"
+ "~$"
+ "\\\\.pyc$"
+ "/tags$"
+ "/(build|BUILD|B)/"
+)
+
+IF(WIN32 AND NOT UNIX)
+ # There is a bug in NSI that does not handle full unix paths properly. Make
+ # sure there is at least one set of four (4) backlasshes.
+ SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}\\\\dondorf-king.bmp")
+ SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\fortune.exe")
+ SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\github.com\\\\shlomif\\\\fortune-mod")
+ SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\github.com\\\\shlomif\\\\fortune-mod")
+ SET(CPACK_NSIS_DISPLAY_NAME "fortune-mod")
+ SET(CPACK_NSIS_CONTACT "shlomif@shlomifish.org")
+ SET(CPACK_NSIS_MODIFY_PATH ON)
+ # Setting for NSIS :
+ SET(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\fc-solve.ico")
+ SET(CPACK_NSIS_MUI_UNIICON ${CPACK_NSIS_MUI_ICON})
+ SET(CPACK_PACKAGE_ICON ${CPACK_NSIS_MUI_ICON})
+ SET(CPACK_NSIS_MODIFY_PATH "ON")
+ELSE()
+ SET(CPACK_STRIP_FILES "fortune")
+ SET(CPACK_SOURCE_STRIP_FILES "")
+ENDIF()
+
+SET(CPACK_PACKAGE_EXECUTABLES
+ "fortune" "The fortune-mod program"
+)
+
+### This is to set the RPATH correctly, so when installed under a prefix
+### the executables will find the libraries.
+###
+### See:
+###
+### http://www.cmake.org/Wiki/CMake_RPATH_handling
+###
+### (Taken from that wiki page)
+
+# use, i.e. don't skip the full RPATH for the build tree
+SET(CMAKE_SKIP_BUILD_RPATH FALSE)
+
+# when building, don't use the install RPATH already
+# (but later on when installing)
+SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+
+# the RPATH to be used when installing
+SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
+
+# add the automatically determined parts of the RPATH
+# which point to directories outside the build tree to the install RPATH
+SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+
+SET (WITH_TEST_SUITE CACHE BOOL "")
--- /dev/null
+/*-
+ * Copyright (c) 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ken Arnold.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* Modified September, 1995, Amy A. Lewis
+ * 1: removed all file-locking dreck. Unnecessary
+ * 2: Fixed bug that made fortune -f report a different list than
+ * fortune with any other parameters, or none, and which forced
+ * the program to read only one file (named 'fortunes')
+ * 3: removed the unnecessary print_file_list()
+ * 4: Added "OFFDIR" to pathnames.h as the directory in which offensive
+ * fortunes are kept. This considerably simplifies our life by
+ * permitting us to dispense with a lot of silly tests for the string
+ * "-o" at the end of a filename.
+ * 5: I think the problems with trying to find filenames were fixed by
+ * the change in the way that offensive files are defined. Two birds,
+ * one stone!
+ * 6: Calculated probabilities for all files, so that -f will print them.
+ */
+
+/* Changes Copyright (c) 1997 Dennis L. Clark. All rights reserved.
+ *
+ * The changes in this file may be freely redistributed, modified or
+ * included in other software, as long as both the above copyright
+ * notice and these conditions appear intact.
+ */
+
+/* Modified May 1997, Dennis L. Clark (dbugger@progsoc.uts.edu.au)
+ * + Various portability fixes
+ * + Percent selection of files with -a now works on datafiles which
+ * appear in both unoffensive and offensive directories (see man page
+ * for details)
+ * + The -s and -l options are now more consistant in their
+ * interpretation of fortune length
+ * + The -s and -l options can now be combined wit the -m option
+ */
+
+/* Modified Jul 1999, Pablo Saratxaga <srtxg@chanae.alphanet.ch>
+ * - added use of the LANG variables; now if called without argument
+ * it will choose (if they exist) fortunes in the users' language.
+ * (that is, under a directory $LANG/ under the main fortunes directory
+ *
+ * Added to debian by Alastair McKinstry, <mckinstry@computer.org>, 2002-07-31
+ */