#
# spec file for package fossil
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define with_system_sqlite 0%{?suse_version} > 1210
Name:           fossil
Version:        1.33
Release:        1.3
Summary:        Simple, high-reliability, distributed software configuration management
License:        BSD-2-Clause
Group:          Development/Tools/Version Control
Url:            http://www.fossil-scm.org/
Source:         http://www.fossil-scm.org/download/%{name}-src-%{version}.tar.gz
# Source2:        http://www.hwaci.com/fossil_download_checksums.html#/%{name}.asc
Patch1:         fossil-1.30-remove_date_time.patch
BuildRequires:  fuse-devel
BuildRequires:  gcc
BuildRequires:  tcl
BuildRequires:  zlib-devel
%if 0%{with_system_sqlite}
BuildRequires:  sqlite3-devel >= 3.8.7
%endif
%if 0%{?suse_version} >= 1140
BuildRequires:  libopenssl-devel
%else
BuildRequires:  openssl-devel
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
There are plenty of open-source version control systems available on
the internet these days. What makes Fossil worthy of attention?

1. Bug Tracking And Wiki - In addition to doing distributed version
control like Git and Mercurial, Fossil also supports distributed bug
tracking and distributed wiki all in a single integrated package.

2. Web Interface - Fossil has a built-in and easy-to-use web interface
that simplifies project tracking and promotes situational
awareness. Simply type "fossil ui" from within any check-out and
Fossil automatically opens your web browser in a page that gives
detailed history and status information on that project.

3. Autosync - Fossil supports "autosync" mode which helps to keep
projects moving forward by reducing the amount of needless forking and
merging often associated with distributed projects.

4. Self-Contained - Fossil is a single stand-alone executable that
contains everything needed to do configuration
management. Installation is trivial: simply download a precompiled
binary for Linux, Mac, or Windows and put it on your
$PATH. Easy-to-compile source code is available for users on other
platforms. Fossil sources are also mostly self-contained, requiring
only the "zlib" library and the standard C library to build.

5. Simple Networking - Fossil uses plain old HTTP (with proxy support)
for all network communications, meaning that it works fine from behind
restrictive firewalls. The protocol is bandwidth efficient to the
point that Fossil can be used comfortably over a dial-up internet
connection.

6. CGI Enabled - No server is required to use fossil. But a server
does make collaboration easier. Fossil supports three different yet
simple server configurations. The most popular is a 2-line CGI
script. This is the approach used by the self-hosting fossil
repositories.

7. Robust & Reliable - Fossil stores content using an enduring file
format in an SQLite database so that transactions are atomic even if
interrupted by a power loss or system crash. Furthermore, automatic
self-checks verify that all aspects of the repository are consistent
prior to each commit. In over three years of operation, no work has
ever been lost after having been committed to a Fossil repository.

%prep
## check tarball hashes
#echo "`grep %{name}-src-%{version}.tar.gz %{SOURCE2} | cut -d' ' -f1`  %{SOURCE0}" | sha1sum -c
%setup -q -n %{name}-src-%{version}
# test package version and source version match
grep -qFx %{version} VERSION
%patch1 -p1

%build
export CFLAGS="%{optflags}"
./configure \
        --prefix=%{_prefix} \
        --with-openssl \
%if 0%{with_system_sqlite}
        --disable-internal-sqlite
%endif

make %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}

%files
%defattr(-,root,root)
%doc COPYRIGHT-BSD2.txt
%{_bindir}/fossil

%changelog
* Mon May 25 2015 astieger@suse.com
- fossil 1.33:
  * Improved fork detection on fossil update, fossil status and
    related commands.
  * Change the default skin to what used to be called "San
    Francisco Modern".
  * Add the /repo-tabsize web page
  * Add fossil import --svn, for importing a subversion repository
    into fossil which was exported using "svnadmin dump".
  * Add the "--compress-only" option to fossil rebuild.
  * Use a pie chart on the /reports?view=byuser page.
  * Enhanced fossil clean --verily so that it ignores keep-glob
    and ignore-glob settings. Added the -x alias for --verily.
  * Add the --soft and --hard options to fossil rm and fossil mv.
  * Improved ability to customize the timelime graph.
  * Improvements to the /sitemap page.
  * Automatically adjust the CLI timeline to the terminal width on Linux.
  * Added [info commands] and [info vars] commands to TH1.
  * Fix some obscure issues with TH1 expression processing.
  * Fix titles in search results for documents that are not wiki,
    markdown, or HTML.
  * Formally translate TH1 to Tcl return codes and vice-versa,
    where necessary, in the Tcl integration subsystem.
  * Add fossil leaves -multiple, for finding multiple leaves on
    the same branch.
  * Added the "Blitz" skin option.
  * Make fossil open honor ".fossil-settings/allow-symlinks".
  * Allow fossil add to be used on symlinks to nonexistent or
    unreadable files in the same way as fossil addremove.
  * Added fork warning to be issued if sync produced a fork
  * Update the info page to report when a file becomes a symlink.
    Additionally show the UUID for files whose types have changed
    without changing contents or symlink target.
  * Have fossil changes and fossil status report when executable
    or symlink status changes on otherwise unmodified files.
  * Permit filtering weekday and file reports by user. Also ensure
    the user parameter is preserved when changing types. Add a
    field for direct entry of the user name to each applicable
    report.
  * Create parent directories of empty-dirs if they don't already
    exist.
  * Inhibit timeline links to wiki pages that have been deleted.
- source tarball signature not available for this release
- new minimum sqlite3 requirement is 3.8.7, build with bundled
  version where it is not available.
* Sat Mar 21 2015 astieger@suse.com
- fossil 1.32:
  * backwards compatibility fixes
  * Anti-aliased rendering of arrowheads on timeline graphs.
  * Added vi/less-style key bindings to the --tk diff GUI.
  * Documentation updates
  * Add the --repolist option to server commands
  * Added the "Xekri" skin.
  * Enhance the "ln=" query parameter on artifact displays to accept
    multiple ranges, separate by spaces (or "+" when URL-encoded).
  * Added fossil forget as an alias for fossil rm.
- includes changes from 1.31:
  * Improve file change graphs, fossil rebuild recommended
  * Optional full-text search, /srchsetup page, fts-config command
  * Improve UI and wiki funktionality
  * new rebuild --ifneeded
  * Added override skins option ("skin:", --skin)
  * Added the /md_rules pages about Markdown format.
  * Added the --repolist and --nojail options to server commands
  * Added the fossil all add subcommand to "fossil all".
  * Improvements to the /login page.
  * Downloads by "nobody" now enabled by default in new repositories.
  * Add IPv6 support to fossil sync and fossil clone
  * Added the /mimetype_list page.
  * Added the /hash-collisions page.
* Tue Jan 20 2015 andreas.stieger@gmx.de
- fossil 1.30:
  * Added the fossil bundle command.
  * Added the fossil purge command.
  * Added the fossil publish command.
  * Added the fossil unpublished command.
  * Add support for Docker.
  * Enhancements and additions to web interface
  * Add the fossil fusefs DIRECTORY command ans FuseFS support for
    examining history
  * Add the administrative log that records all configuration.
  * Improvements to command line interface
  * Use full 40-character SHA1 hashes (instead of abbreviations)
    in most internal URLs.
  * Improvements to sync resilience
  * Fix CVE-2014-3566 "POODLE SSL 3.0" vulnerability.
- build with system sqlite that have a new enough version
- build with fuse
- update fossil-1.29-remove_date_time.patch
  to fossil-1.30-remove_date_time.patch
* Mon Sep 22 2014 andreas.stieger@gmx.de
- fossil 1.29:
  * Add the ability to display content, diffs and annotations for
    UTF16 text files in the web interface.
  * Add the "SaveAs..." and "Invert" buttons to the graphical diff
    display that results from using the --tk option with the fossil
    diff command.
  * The /reports page now requires Read ("o") permissions. The
    "byweek" report now properly propagates the selected year
    through the event type filter links.
  * The info command now shows leaf status of the checkout.
  * Add support for tunneling https through a http proxy
  * Add option --empty to the "fossil open" command.
  * Enhanced the fileage page to support a glob parameter.
  * Add -w|--ignore-all-space and -Z|--ignore-trailing-space
    options to fossil annotate, fossil blame, fossil (g)diff,
    fossil stash diff.
  * Add --strip-trailing-cr option to fossil (g)diff and fossil
    stash diff.
  * Add button "Ignore Whitespace" to /annotate, /blame, /ci, /fdiff
    and /vdiff UI pages.
  * Enhance /reports with a "byweekday" view.
  * Enhance the fossil cat command so that it works outside of a
    checkout when using the -R command-line option.
  * Use full-length SHA1 hashes, not abbreviations, in most
    hyperlinks.
  * Correctly render the <title> markup on wiki pages in the
    /artifact webpage.
  * Enhance the fossil whatis command to report on attachments
    and cluster artifacts. Added the /help?cmd=test-whatis-all
    command for testing purposes.
  * Add support for HTTP Basic Authentication on clone and sync.
  * Fix the stash so that it remembers added files and re-adds them
    when the stash is applied.
  * Fix the server so that it avoids writing to the database (and
    thus avoids database locking issues) on a pull or clone.
  * Add support for server load management using both a cache of
    expensive pages (the fossil cache command) and by rejecting
    expensive page requests when the server load average is too
    high.
  * Add the fossil praise command as an alias for fossil blame for
    subversion compatibility.
  * Enhance the fossil test-diff command with -y or --tk options so
    that it shows both filenames above their respective columns in
    the side-by-side diff output.
  * Issue a warning if a fossil add command tries to add a file that
    matches the ignore-glob.
  * Add option -W|--width to "fossil stash ls" and "fossil leaves"
    commands.
  * Enhance support for running as the root user
  * Added the -empty option to fossil new, which causes it to not
    create an initial empty commit. The first commit after
    checking out a repo created this way will become the initial
    commit.
  * Enhance sync operations by committing each round-trip to
    minimize number of retransmits when autosync fails. Include
    option for fossil update and fossil merge to continue even if
    missing content.
  * Minor portability fixes for platforms where the char type is
    unsigned by default.
- use source URLs
- verify source signatures
- add fossil-1.29-remove_date_time.patch to fix packaging warning
* Thu May 22 2014 max@suse.de
- Update to version 1.28:
  * Enhance /reports to support event type filtering.
  * When cloning a repository, the user name passed via the URL
    (if any) is now used as the default local admin user's name.
  * Enhance the SSH transport mechanism so that it runs a single
    instance of the "fossil" executable on the remote side,
    obviating the need for a shell on the remote side. Some users
    may need to add the "?fossil=/path/to/fossil" query parameter
    to "ssh:" URIs if their fossil binary is not in a standard
    place.
  * Add the "fossil blame" command that works just like "fossil
    annotate" but uses a different output format that includes the
    user who made each changes and omits line numbers.
  * Add the "Tarball and ZIP-archive Prefix" configuration
    parameter under Admin/Configuration.
  * Fix CGI processing so that it works on web servers that do not
    supply REQUEST_URI.
  * Add options --dirsonly, --emptydirs, and --allckouts to the
    "fossil clean" command.
  * Ten-fold performance improvement in large "fossil blame" or
    "fossil annotate" commands.
  * Add option -W|--width and --offset to "fossil timeline" and
    "fossil finfo" commands.
  * Option -n|--limit of "fossil timeline" now specifies the
    number of entries, just like all other commands which have the
  - n|--limit option. The various timeline-related functions now
    output "--- ?? limit (??) reached ---" at the end whenever
    appropriate. Use "-n 0" if no limit is desired.
  * Fix handling of password embedded in Fossil URL.
  * New --once option to fossil clone command which does not store
    the URL or password when cloning.
  * Modify fossil ui to respect "default user" in an open
    repository.
  * Fossil now hides check-ins that have the "hidden" tag in
    timeline webpages.
  * Enhance /ci_edit page to add the "hidden" tag to check-ins.
  * Advanced possibilities for commit and ticket change
    notifications over http using TH1 scripting.
  * Add --sha1sum and --integrate options to the "fossil commit"
    command.
  * Add the "clean" and "extra" subcommands to the "fossil all"
    command
  * Add the --whatif option to "fossil clean" that works the same
    as "--dry-run", so that the name does not collide with the
  - -dry-run option of "fossil all".
  * Provide a configuration option to show dates on the web
    timeline as "YYMMMDD HH:MM"
  * Add an option to the "stats" webpage that allows an
    administrator to see the current repository schema.
  * Enhancements to the "/vdiff" webpage for more difference
    display options.
  * Added the "/tree" webpage as an alternative to "/dir" and make
    it the default way of showing file lists.
  * Send gzipped HTTP responses to clients that support it.
* Tue Oct 15 2013 max@suse.com
- Update to Version 1.27
  * Enhance the fossil changes, fossil clean, fossil extras,
    fossil ls and fossil status commands to restrict operation to
    files and directories named on the command-line.
  * New --integrate option to fossil merge, which automatically
    closes the merged branch when committing.
  * Renamed /stats_report page to /reports. Graph width is now
    relative, not absolute.
  * Added yw=YYYY-WW (year-week) filter to timeline to limit the
    results to a specific year and calendar week number,
    e.g. /timeline?yw=2013-01.
  * Updates to SQLite to prevent opening a repository file using
    file descriptors 1 or 2 on unix. This fixes a bug under which
    an assertion failure could overwrite part of a repository
    database file, corrupting it.
  * Added support for unlimited line lengths in side-by-side
    diffs.
  * New --close option to fossil commit, which immediately closes
    the branch being committed.
  * Added chart option to fossil bisect.
  * Improvements to the "human or bot?" determination.
  * Reports errors about missing CGI-standard environment
    variables for HTTP servers which do not support them.
  * Added --scgi option to fossil server.
  * Internal improvements to the sync process.
  * The internals of the JSON API are now MIT-licensed, so
    downstream users/packagers are no longer affected by the "do
    no evil" license clause.
  * The argument to the --port option for the "fossil ui" and
    "fossil server" commands can take an IP address in addition to
    the port number, causing Fossil to bind to just that one IP
    address.
  * After prompting for a password, also ask if that password
    should be remembered.
  * Performance improvements to the diff engine.
  * Fix the side-by-side diff engine to work better with
    multi-byte unicode text.
  * Color-coding in the web-based annotation (blame) display. Fix
    the annotation engine so that it is no longer confused by
    time-warps.
  * The markdown formatter is now available by default and can be
    used for tickets, wiki, and embedded documentation.
  * Add subcommands "fossil bisect log" and "fossil bisect status"
    to the "fossil bisect" command, as well as other bisect
    enhancements.
  * Enhanced defenses that prevent spiders from using excessive
    CPU and bandwidth.
  * Consistent use of the -n or --dry-run command line options.
  * Enhancements to /timeline.rss, adding more flags for filtering
    results, including the ability to subscribe to changes made to
    individual tickets.
  * Improved handling of the differences between case-sensitive
    and case-insensitive filesystems.
  * JSON API: added the 'status' command to report local checkout
    status.
  * Fixes to the --args support and documented this feature in the
    help.
  * Added /stats_report page.
  * Added ym=YYYY-MM filter to the "/timeline" url.
  * Fixed: config reset now re-installs default ticket report
    format.
  * ssh:// and file:// protocols now ignore proxy settings.
  * Added /hash-color-test web page.
  * Cherry-pick merges are recorded internally (though no yet
    displayed on the timeline graph.)
  * Bring in the latest versions of SQLite, zlib, and autosetup
    from upstream.
* Mon Feb 18 2013 mmeister@suse.com
- Update to Version 1.25
  * Timeline Nodes in the ui selectable to diff between two nodes.
  * Added and enhanced a few commands and options.
  * Added a few JavaScripts to the web ui.
* Thu Nov 22 2012 max@suse.com
- Update to version 1.24 and change the versioning scheme from
  time stamp to upstream version number. This shouldn't be a
  problem, because fossil never was on Factory or any release.
* Wed Jun  1 2011 prusnak@opensuse.org
- updated to 20110528185122
  - see changelog at http://www.fossil-scm.org/index.html/timeline
* Sun Apr  3 2011 jw@novell.com
- updated to 20110316111914
  The changelog from upstream is huge
  http://www.fossil-scm.org/index.html/timeline
  has ca. 600 checkins since 2010-09
* Tue Sep 28 2010 prusnak@opensuse.org
- updated to 20100918155143
* Wed Sep  8 2010 dmacvicar@novell.com
- initial package based on version 20100823222416