[openstv] Initial import (#1076186)
David King
amigadave at fedoraproject.org
Mon May 19 13:46:39 UTC 2014
commit d7490e87f13d40673aa20f24335b08e0da180b9e
Author: David King <amigadave at amigadave.com>
Date: Mon May 19 15:44:05 2014 +0200
Initial import (#1076186)
.gitignore | 1 +
openstv | 8 +++
openstv-1.7-setup-package-data.patch | 11 ++++
openstv-run-election | 3 +
openstv-run-election.1 | 68 ++++++++++++++++++++++++
openstv.1 | 40 ++++++++++++++
openstv.appdata.xml | 24 +++++++++
openstv.desktop | 10 ++++
openstv.spec | 94 ++++++++++++++++++++++++++++++++++
sources | 1 +
10 files changed, 260 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..8f4ef51 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/openstv-19796b19b3f1eff5513e2299cf8dfe918f93eb56.tar.gz
diff --git a/openstv b/openstv
new file mode 100644
index 0000000..d21d617
--- /dev/null
+++ b/openstv
@@ -0,0 +1,8 @@
+#!/usr/bin/python
+
+#import sys
+#sys.path.append("/usr/share/openstv");
+
+from openstv.OpenSTV import App
+app = App(0)
+app.MainLoop()
diff --git a/openstv-1.7-setup-package-data.patch b/openstv-1.7-setup-package-data.patch
new file mode 100644
index 0000000..02c8038
--- /dev/null
+++ b/openstv-1.7-setup-package-data.patch
@@ -0,0 +1,11 @@
+Install icons, splash screen as well as HTML files used by the application.
+
+Downloaded from http://anonscm.debian.org/viewvc/python-apps/packages/openstv/trunk/debian/patches/setup-package-data.patch?revision=5646&view=co
+--- a/setup.py
++++ b/setup.py
+@@ -85,4 +85,5 @@
+ url = url,
+ license = license,
+ packages = packages,
++ package_data = {'openstv': ['Icons/*.ico', 'Icons/*.png', '*.html']}
+ )
diff --git a/openstv-run-election b/openstv-run-election
new file mode 100644
index 0000000..ac660c8
--- /dev/null
+++ b/openstv-run-election
@@ -0,0 +1,3 @@
+#!/usr/bin/python
+
+import openstv.runElection
diff --git a/openstv-run-election.1 b/openstv-run-election.1
new file mode 100644
index 0000000..6e94f35
--- /dev/null
+++ b/openstv-run-election.1
@@ -0,0 +1,68 @@
+.TH OPENSTV-RUN-ELECTION 1 "November 2010" "1.7"
+
+.SH NAME
+OpenSTV - Single Transferable Vote and Instant Runoff Voting Software
+
+.SH SYNOPSIS
+.B openstv-run-election [\fIOPTION\fP] \fIMETHOD\fP \fIBALLOT_FILE\fP
+
+.SH DESCRIPTION
+Runs an election for a given \fIMETHOD\fP and \fIBALLOT_FILE\fP.
+Results are printed to the standard output. The following methods are available:
+
+ Approval
+ Borda
+ Bucklin
+ CambridgeSTV
+ Condorcet
+ Coombs
+ ERS97STV
+ FTSTV
+ GPCA2000STV
+ IRV
+ MeekNZSTV
+ MeekQXSTV
+ MeekSTV
+ MinneapolisSTV
+ NIrelandSTV
+ QPQ
+ RTSTV
+ SNTV
+ ScottishSTV
+ SuppVote
+ WarrenQXSTV
+ WarrenSTV
+
+.SH OPTIONS
+.TP
+\fB-p\fP \fIPREC\fP
+Override default precision (in digits).
+.TP
+\fB-r\fP \fIFORMAT\fP
+Report format: CsvReport, HtmlReport, MinimalReport, TextReport or YamlReport
+.TP
+\fB-t\fP \fITIEBREAK\fP
+Strong tie-break method: random (default), alpha or index
+.TP
+\fB-w\fP \fIWEAKTIE\fP
+Weak tie-break method: method-default (default), strong, forward or backward
+.TP
+\fB-s\fP \fISEATS\fP
+Number of seats (for text-format ballot files).
+.TP
+\fB-P\fP
+Profile and send output to profile.out
+.TP
+\fB-x\fP \fINUM\fP
+Specify repeat count (for profiling).
+
+.SH SEE ALSO
+.B Homepage:
+http://www.openstv.org/
+
+.SH AUTHOR
+This manual page was written by Severin Heiniger <severinheiniger at gmail.com> for the Debian system (but may be used by others).
+
+Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or any later version published by the Free Software Foundation.
+
+On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.
diff --git a/openstv.1 b/openstv.1
new file mode 100644
index 0000000..5668f1c
--- /dev/null
+++ b/openstv.1
@@ -0,0 +1,40 @@
+.TH OPENSTV 1 "November 2010" "1.7"
+
+.SH NAME
+OpenSTV - Single Transferable Vote and Instant Runoff Voting Software
+
+.SH SYNOPSIS
+.B openstv
+
+.SH DESCRIPTION
+.B OpenSTV
+is open-source software for implementing the single transferable vote
+and other voting methods such as instant runoff voting, condorcet voting, and
+approval voting.
+. B OpenSTV
+is the only open-source software that implements the
+single transferable vote exactly as used by governments, including Scotland
+and the City of Cambridge, Massachusetts. These methods have been extensively
+verified against other software and/or actual election results.
+
+Organizations can use
+.B OpenSTV
+to implement their own elections.
+First, the organization must adopt a voting method. Second, the organization
+must conduct the vote, and this will most likely be done with paper ballots.
+Third, the ballots must be entered into the
+.B OpenSTV
+program. Finally, you can use
+.B OpenSTV
+to count the votes and determine the winners of the election.
+
+.SH SEE ALSO
+.B Homepage:
+http://www.openstv.org/
+
+.SH AUTHOR
+This manual page was written by Severin Heiniger <severinheiniger at gmail.com> for the Debian system (but may be used by others).
+
+Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or any later version published by the Free Software Foundation.
+
+On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.
diff --git a/openstv.appdata.xml b/openstv.appdata.xml
new file mode 100644
index 0000000..5ad5225
--- /dev/null
+++ b/openstv.appdata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2014 David King <amigadave at amigadave.com> -->
+<application>
+ <id type="desktop">openstv.desktop</id>
+ <metadata_license>CC0-1.0</metadata_license>
+ <project_license>GPL-2.0+</project_license>
+ <description>
+ <p>OpenSTV is open-source software for implementing the single
+ transferable vote and other voting methods such as instant runoff
+ voting, Condorcet voting, and approval voting. OpenSTV is the only
+ open-source software that implements the single transferable vote
+ exactly as used by governments, including Scotland and the City of
+ Cambridge, Massachusetts. These methods have been extensively verified
+ against other software and/or actual election results.</p>
+ <p>Organizations can use OpenSTV to implement their own elections.
+ First, the organization must adopt a voting method. Second, the
+ organization must conduct the vote, and this will most likely be done
+ with paper ballots. Third, the ballots must be entered into the OpenSTV
+ program. Finally, you can use OpenSTV to count the votes and determine
+ the winners of the election.</p>
+ </description>
+ <url type="homepage">https://github.com/OpenTechStrategies/openstv</url>
+ <updatecontact>amigadave at amigadave.com</updatecontact>
+</application>
diff --git a/openstv.desktop b/openstv.desktop
new file mode 100644
index 0000000..1d3accc
--- /dev/null
+++ b/openstv.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Version=1.0
+Name=OpenSTV Voting Software
+GenericName=Voting Software
+Comment=Conduct a Single Transferable Vote election
+Categories=Office;
+Exec=openstv
+Icon=openstv
+Terminal=false
+Type=Application
diff --git a/openstv.spec b/openstv.spec
new file mode 100644
index 0000000..c10b9de
--- /dev/null
+++ b/openstv.spec
@@ -0,0 +1,94 @@
+%global commit 19796b19b3f1eff5513e2299cf8dfe918f93eb56
+%global shortcommit %(c=%{commit}; echo ${c:0:7})
+
+Name: openstv
+Version: 1.7
+Release: 1%{?dist}
+Summary: Single transferable vote and instant runoff voting software
+
+Group: Applications/Productivity
+License: GPLv2+
+URL: https://github.com/OpenTechStrategies/%{name}
+Source0: https://github.com/OpenTechStrategies/%{name}/archive/%{commit}/%{name}-%{commit}.tar.gz
+Source1: openstv
+Source2: openstv-run-election
+Source3: openstv.1
+Source4: openstv-run-election.1
+Source5: openstv.desktop
+Source6: openstv.appdata.xml
+# Install icons, image and HTML documentation used by the application
+Patch0: openstv-1.7-setup-package-data.patch
+
+BuildArch: noarch
+BuildRequires: desktop-file-utils
+BuildRequires: icoutils
+BuildRequires: python2-devel
+Requires: hicolor-icon-theme
+Requires: wxPython
+
+%description
+OpenSTV is an open-source software for implementing the single transferable
+vote and other voting methods such as instant runoff voting, Condorcet voting,
+and approval voting. OpenSTV is the only open-source software that implements
+the single transferable vote exactly as used by governments, including Scotland
+and the City of Cambridge, Massachusetts. These methods have been extensively
+verified against other software and/or actual election results.
+
+Organizations can use OpenSTV to implement their own elections. First, the
+organization must adopt a voting method. Second, the organization must conduct
+the vote, and this will most likely be done with paper ballots. Third, the
+ballots must be entered into the OpenSTV program. Finally, you can use OpenSTV
+to count the votes and determine the winners of the election.
+
+%prep
+%setup -q -n %{name}-%{commit}
+sed -i 's:#!/usr/bin/env python:# Run openstv instead:' openstv/OpenSTV.py
+sed -i 's:#!/usr/bin/env python:# Run openstv-run-election instead:' openstv/runElection.py
+%patch0 -p1
+icotool --extract --index=7 openstv/Icons/pie.ico
+mv pie_7_48x48x32.png %{name}.png
+
+
+%build
+%{__python2} setup.py build
+
+
+%install
+%{__python2} setup.py install --root=%{buildroot}
+install -Dpm 0755 %{SOURCE1} %{buildroot}%{_bindir}/openstv
+install -pm 0755 %{SOURCE2} %{buildroot}%{_bindir}/openstv-run-election
+install -Dpm 0644 %{SOURCE3} %{buildroot}%{_mandir}/man1/openstv.1
+install -pm 0644 %{SOURCE4} %{buildroot}%{_mandir}/man1/openstv-run-election.1
+desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE5}
+install -Dpm 0644 %{name}.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
+install -Dpm 0644 %{SOURCE6} %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml
+ln -sf %{python2_sitelib}/%{name}/License.html License.html
+
+%post
+touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
+
+%postun
+if [ $1 -eq 0 ] ; then
+ touch --no-create %{_datadir}/icons/hicolor &>/dev/null
+ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+fi
+
+%posttrans
+gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+
+
+%files
+%doc CHANGELOG.txt License.html README.md
+%{_bindir}/%{name}*
+%{python2_sitelib}/%{name}/
+%{python2_sitelib}/OpenSTV-%{version}-*.egg-info
+%{_mandir}/man1/%{name}*.1.gz
+%{_datadir}/appdata/%{name}.appdata.xml
+%{_datadir}/applications/%{name}.desktop
+%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
+
+
+
+%changelog
+* Mon May 19 2014 David King <amigadave at amigadave.com> - 1.7-1
+- Initial import (#1076186)
diff --git a/sources b/sources
index e69de29..e137a5e 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+7371780a4d9ebf753f43a3d858f1f8ca openstv-19796b19b3f1eff5513e2299cf8dfe918f93eb56.tar.gz
More information about the scm-commits
mailing list