INSTALL 12.2 KB
Newer Older
1
DEPENDENCIES
2 3
============

4 5
    Required
    ========
6
    
7 8 9 10 11 12 13 14 15 16 17 18
        * Python 2.6, 2.7 or 3.x
        * The curses module. (Python bindings for curses.)
        * A screen size of at least 10 columns by 8 rows.
          (7 by 4 for non-hexagonal gametypes.)
        * A unix-like operating system or the argparse module.
    
    Recommended
    ===========
    
        * less(1) for the passwords is recommended.
        * A unix-like OS is recommended for systems with a multicore CPU
        * PyPy or another faster Python implementation can be used.
19
    
20
    NOTICE: Normal installation will only work on unix-like operating
21 22
    systems.
    
23
    On non unix-like systems you must specify the location of both
24 25
    configuration files, which is why the argparse module would
    be required on a non-nix platform.
26
    
27

Oskar Skog's avatar
Oskar Skog committed
28
Mac OS X
29 30 31 32 33 34
========

    NOTICE:  This has not been tested.  Please report any issues to
    oskar.skog.finland@gmail.com
    
    You need to install as admin.
35 36
    You also need to have parts of Xcode installed, I believe they will
    automatically install on recent enough versions of OS X.
37 38 39 40 41 42 43 44 45 46 47 48 49
    
    Download and extract the archive and open a terminal window and
    navigate to the extracted directory with the `cd` command.
    
        cd Downloads/anonymine-*
    
    See this site for more information:
https://www.macworld.co.uk/feature/mac-software/how-use-terminal-on-mac-3608274/
    
    Then run the commands:
        ./configure -v
        make
        sudo make install
user's avatar
user committed
50
    (The last one should prompt for your password)
51
    
52

53 54
INSTALLATION
============
55

56 57
    NOTICE: This section only applies to unix-like systems.
    
58 59 60 61 62
    In the directory extracted from the tarball, run:
        ./configure
        make
        make install        # as root
    
63 64 65
    If you don't understand the above, go read
http://www.makeuseof.com/tag/compile-install-tar-gz-tar-bz2-files-ubuntu-linux/
    If you still don't understand, ask the nearest Linux user to help you
Oskar Skog's avatar
Oskar Skog committed
66
    and create a wiki page about the topic on my Gitlab repo.
67
    
68
    Use "./configure -v" to make the whole installation process verbose.
69 70 71 72
    
    The Makefile works with both GNU's make and BSD's make, but it does not
    work on Sun's make.  If `make` doesn't work, try using `gmake` instead.
    
73 74
    NOTICE:
        The system-wide configuration files for the game will only be created
75 76 77 78 79 80 81
        if they do not exist or if they have not been modified by the user.
        `make install` will fail if the format of the configuration has
        changed and incompatible configuration files that have been modified
        exist.
        
        If you don't modify the system-wide configuration files, installation
        will not fail because of this.
82 83 84 85
        
        To force an overwrite of the system-wide configuration files, run
        `make overwrite-cfg`.  If you do this because of a failed make install,
        run make install again.
86 87
    
    
88 89 90 91
    Anonymine will be installed as 'anonymine'.
    
    Run "make print-destinations" to find out where files will be installed.
    
92 93 94 95
    
    Important notes
    ===============
    
96 97
        * System wide configuration files, even if altered, will be deleted
          on uninstall.
98
        * The highscores file will be deleted on uninstall.
99
        * Anonymine expects to be run by "python", not "python2.7" etc.
100
        * Do not make any target that is not listed in the list of Makefile
101 102 103
          targets.  If you know what you're doing, it's okay.
        * ./configure and Makefile are not made with the GNU Autotools.
          The build system may behave unexpectedly.
104 105 106 107 108 109


Advanced installation
=====================

    NOTICE: This section only applies to unix-like systems.
110 111 112 113 114
    
    
    ./configure; make; make install
    ===============================
    
115 116
        NOTICE: ./configure is not made with GNU Autoconf.
    
117 118 119 120 121
        ./configure will accept variables with three different syntaxes:
            ./configure --name value
            ./configure --name=value
            ./configure name=value
        
122
        All variables require exactly one value/argument.
123 124 125
        All variables will also be stored in the Makefile.
        
        The value of a variable MAY be a Makefile variable/macro.
126
        Ex: `./configure 'bindir=$(prefix)/bin'`
127
        
128 129 130 131
        You can override the variables stored in Makefile, but avoid
        overriding srcdir and builddir, those two should only be sent
        to ./configure.
        
132 133 134 135 136 137 138 139 140
        The value entered on the command line will not be pre-expanded in the
        Makefile, except for "builddir" and "srcdir".  The exception is there
        to prevent issues when make is run from a different directory than
        configure.
            "srcdir" and "builddir" will automatically be converted to absolute
            paths.
        
        configure will also accept these short options:
            -f      Force; write the Makefile even if there were errors.
Oskar Skog's avatar
Oskar Skog committed
141
            -v      verbose; this also affects the Makefile
142
        
143 144
        The real "configure" script will handle these iff they are the ONLY
        argument to ./configure:
145 146 147 148 149 150
            ./configure -h
            ./configure -V
            ./configure --help
            ./configure --version
    
    
151
    Recognized variables
152 153 154 155 156
    ====================
    
        Variable                default and/or description
        --------                --------------------------
        
user's avatar
user committed
157
        prefix                  /usr/local, /usr
Oskar Skog's avatar
Oskar Skog committed
158
        bindir                  $(prefix)/bin        # NOTE 1
159 160
        gamesdir                $(prefix)/games
        libdir                  $(prefix)/lib
Oskar Skog's avatar
Oskar Skog committed
161
        localstatedir           $(prefix)/var, /var
162
        sysconfdir              $(prefix)/etc, /etc
Oskar Skog's avatar
Oskar Skog committed
163
        vargamesdir             $(localstatedir)/games, $(localstatedir)
164
        
165 166
        python                  Path to the Python interpreter.
        
167 168 169
        EXECUTABLES             This program will be installed in $(gamesdir)
        MODULES                 See its own subsection
        
170
        INSTALL                 which install(8) utility to use.
user's avatar
user committed
171
                                (/usr/ucb/install on Solaris and similar)
172
        
173
        DESTDIR                 Pretend the root is here (staged installs)
174 175 176
        srcdir                  The directory extracted from the tarball.
        builddir                (Current working directory)
        
177 178
        freedesktop             'true' or 'false'; "Linux" desktop
        macosx                  'true' or 'false'; Mac OS X
179
        
user's avatar
user committed
180
        
181
        NOTE 1: gamesdir, bindir
Oskar Skog's avatar
Oskar Skog committed
182
            gamesdir will override bindir if possible, so setting bindir
183
            might have no effect.
Oskar Skog's avatar
Oskar Skog committed
184 185
        
        prefix, bindir and libdir, localstatedir, sysconfdir:
186 187
            http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
        
Oskar Skog's avatar
Oskar Skog committed
188 189 190 191 192
        sysconfdir
            Configuration files will be stored in $(sysconfdir)/anonymine/
        
        vargamesdir
            The highscores file is $(vargamesdir)/anonymine
193
        
194 195 196 197
        python
            Can be set to use a different version/implementation than what
            ./configure has chosen automatically.
        
198 199 200 201 202 203 204 205 206 207
        EXECUTABLES
        ===========
        
            This is the directory to which this game will be installed.
            
            It will be assigned to the first variable of [gamesdir, bindir]
            that expands into a path that exists in $PATH.
            
            As a consequence: The game will probably not be installed where
            you want it to if you specify bindir=somewhere-else as it installs
208
            to gamesdir rather than bindir whenever possible.
209 210
        
        
211 212
        MODULES
        =======
213 214 215 216
            
            This game works with both versions of Python, and installs three
            modules that could be used by some other program.
            
217
            The modules will be copied to $(MODULES).
218 219 220 221 222
            
            $(major) and $(minor) are pre-expanded and do NOT exist in the
            Makefile.
    
    
223 224
        srcdir, builddir and DESTDIR
        ============================
225
        
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
            srcdir          Directory extracted from the tarball.
            
            builddir        Temporary storage;
                            directory for files from the build process.
            
            DESTDIR         Prepended to all paths on install and uninstall;
                            alternative root.  (For staged installations.)
            
            
            $(srcdir) is the directory that was extracted from the tarball.
            $(builddir) is the directory where make(1) is allowed to create
            "temporary" files when building (`make [all]`) the program.
            
            Both srcdir and builddir default to the current working directory.
            
            Sending builddir=foo to ./configure will create the Makefile
            inside builddir. You can cd to builddir and run
            `make && sudo make install` without specifiying any arguments
            to make.
            
            You should only send srcdir and builddir to ./configure, not to
            make.
            
            DESTDIR only affects make install, make uninstall, etc.  It has
            zero effect on ./configure.
251
    
252
    
253 254 255
    Targets in the Makefile
    =======================
    
256
        NOTICE:  DO NOT attempt to make any other target than what is
257 258
        listed here.  `make` will not remake Makefile if you try to build
        any other target.
259
        
260 261 262 263 264 265
        all (default)
            Fix the shebang line of the programs to be installed
        
        clean
            Remove stage files and bytecode.
        
Oskar Skog's avatar
Oskar Skog committed
266 267 268 269
        distclean
            Like clean, but also remove the Makefile.
            rm $(builddir)Makefile
        
270 271 272 273
        print-destinations
            Print where things will be installed.
        
        install
274 275 276 277
            Altered configuration files will not be touched by this target.
            If the existing configuration file is incompatible but does not
            identify itself as unmodified, installation will fail and the
            configuration file must be manually edited.
278
        
279 280 281
        install-dirs
            Install the destination directories.
        
282
        uninstall
Oskar Skog's avatar
Oskar Skog committed
283 284 285 286 287
            (Does not recreate Makefile.)
        
        nuke
            Uninstall. Removes highscores file and configuration files.
            (Does not recreate Makefile.)
288
        
289 290 291 292 293 294
        check-install-cfg
            Install system-wide configuration files, but do not overwrite
            user-modified files.  This target will fail if the existing
            configuration files have been modified and are not compatible
            with the new version of Anonymine.
        
295 296 297 298
        overwrite-cfg
            Force compatible configuration files to be installed.
            WARNING: User modified files will be overwritten.
        
299 300 301 302 303 304 305 306 307
        check
            Check that everything seems to work.
        
        release
            (You are me.)
        
        make dist
            'check' that I am not making an embarrassing release,
            make 'tarballs' and the 'zip' and 'release' them.
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332
    
    
    Multiple Python versions or implementations
    ===========================================
    
        After having run "make", you can run
        "<python-implementation> symlinks install" in builddir,
        python-implementation is the command for the python implementation
        to which you want to install symlinks for the Anonymine modules.
        
        The "symlinks" script is generated during "make all".  If you want
        to use DESTDIR, you'll have to send DESTDIR to either `./configure`
        or `make`; you can't send it only to `make install`.
        
        "<python-implementation> symlinks unintstall" does what you should
        expect it to do.
        
        If the main version (the Python version to which the real files have
        been installed) has changed, run:
            ./configure -v # DESTDIR=foo
            make
            sudo make install
            oldpython symlinks install
            # (You need to install them before you uninstall them.)
            #oldpython symlinks uninstall
333 334 335 336 337


TL;DR
=====

338
    ./configure -v && make && sudo make install