% Copyright 2007 by Nathanaël COTTIN <www.ncottin.net>.
%
% This program can be redistributed and/or modified under the terms
% of the GNU Public License, version 3.

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{gnulicenses}[2008/01/22 version 1.1.0]

\RequirePackage{ifthen}

\provideboolean{@french}

\newcommand{\gnufdl}[3][] % [Version] Date / Author
	{\makecopyrighttitle{#2}{#3}
	\if@french
		Permission est accordée de copier, distribuer et/ou modifier ce document selon les termes de la Licence Publique de Documentation GNU, Version \licenseversion{#1}{1.2} ou ultérieure publiée par la Free Software Foundation\,; sans Sections Inaltérables, ni Textes de Première Page de Couverture, ni Textes de Dernière Page de Couverture.
	\else
		Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version \licenseversion{#1}{1.2} or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
	\fi}

\newcommand{\gnugpl}[3][] % [Version] Date / Author
	{\makecopyrighttitle{#2}{#3}
	\if@french
		Ce programme est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier au titre des clauses de la Licence Publique Générale GNU, telle que publiée par la Free Software Foundation\,; soit la version \licenseversion{#1}{3} de la Licence, ou (à votre discrétion) une version ultérieure quelconque.\\
		Ce programme est distribué dans l'espoir qu'il sera utile, mais SANS AUCUNE GARANTIE\,; sans même une garantie implicite de COMMERCIABILITE ou DE CONFORMITE A UNE UTILISATION PARTICULIERE. Voir la Licence Publique Générale GNU pour plus de détails.\\
		Vous devriez avoir reçu un exemplaire de la Licence Publique Générale GNU avec ce programme\,; si tel n'est pas le cas, écrivez à la Free Software Foundation Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
	\else
		This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.\\
		This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\\
		You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
	\fi}

\newcommand{\makecopyrighttitle}[2] % Date / Author
	{\emph{Copyright #1\quad-\quad#2}\newline}

\newcommand{\licenseversion}[2]
	{\ifthenelse
		{\equal{#1}{}}
		{#2}
		{#1}}

