commit e7713836cc16d5226fac0bd5c7c8ba6eba16ec9e
Author: Rafael J. García Perdigón <root@localhost>
Date:   Tue Jul 21 10:40:43 2020 +0200

    Creado linex-mirror

diff --git a/debian/all/linex-mirror/debian/changelog b/debian/all/linex-mirror/debian/changelog
new file mode 100644
index 0000000..41edb5e
--- /dev/null
+++ b/debian/all/linex-mirror/debian/changelog
@@ -0,0 +1,11 @@
+linex-mirror (1.1) linex; urgency=medium
+
+  * Created directories for repos and apache2. 
+
+ -- Rafael J. García Perdigón <rafael.garciap@juntaex.es>  Tue, 21 Jul 2020 10:26:18 +0200
+
+linex-mirror (1.0) linex; urgency=medium
+
+  * Initial Release.
+
+ -- Rafael J. García Perdigón <rafael.garciap@juntaex.es>  Fri, 17 Jul 2020 12:18:26 +0200
diff --git a/debian/all/linex-mirror/debian/compat b/debian/all/linex-mirror/debian/compat
new file mode 100644
index 0000000..f599e28
--- /dev/null
+++ b/debian/all/linex-mirror/debian/compat
@@ -0,0 +1 @@
+10
diff --git a/debian/all/linex-mirror/debian/control b/debian/all/linex-mirror/debian/control
new file mode 100644
index 0000000..6aea2be
--- /dev/null
+++ b/debian/all/linex-mirror/debian/control
@@ -0,0 +1,12 @@
+Source: linex-mirror
+Section: admin
+Priority: extra
+Maintainer: Rafael Jesús García Perdigón<rafael.garciap@juntaex.es>
+Build-Depends: debhelper (>= 10.0.0)
+Standards-Version: 3.9.4
+
+Package: linex-mirror
+Architecture: all
+Pre-Depends: apt-mirror,apache2
+Description: linex apt-mirror config 
+ Configure apt-mirror with linex repositories configurations.
diff --git a/debian/all/linex-mirror/debian/copyright b/debian/all/linex-mirror/debian/copyright
new file mode 100644
index 0000000..7a41474
--- /dev/null
+++ b/debian/all/linex-mirror/debian/copyright
@@ -0,0 +1,28 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: linex-miror
+
+Files: *
+Copyright: 2014 Gobierno de Extremadura
+License: GPL-3.0+
+
+Files: debian/*
+Copyright: 2014 Gobierno de Extremadura
+License: GPL-3.0+
+
+License: GPL-3.0+
+ 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 package 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, see <http://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
+
diff --git a/debian/all/linex-mirror/debian/install b/debian/all/linex-mirror/debian/install
new file mode 100644
index 0000000..73752c9
--- /dev/null
+++ b/debian/all/linex-mirror/debian/install
@@ -0,0 +1 @@
+usr
diff --git a/debian/all/linex-mirror/debian/linex-mirror.links b/debian/all/linex-mirror/debian/linex-mirror.links
new file mode 100644
index 0000000..a4c0fee
--- /dev/null
+++ b/debian/all/linex-mirror/debian/linex-mirror.links
@@ -0,0 +1,4 @@
+/usr/share/linex-mirror/mirror.list /etc/apt/mirror.list 
+/usr/share/linex-mirror/apt-mirror /etc/cron.d/apt-mirror
+
+
diff --git a/debian/all/linex-mirror/debian/postinst b/debian/all/linex-mirror/debian/postinst
new file mode 100755
index 0000000..ec172b6
--- /dev/null
+++ b/debian/all/linex-mirror/debian/postinst
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -e
+
+# Lista de Repos de los que crear un mirror.
+REPOS="es.archive.ubuntu.com security.ubuntu.com"
+
+#Ruta base donde almacenar el mirror.
+base_path=`cat /usr/share/linex-mirror/mirror.list |grep "^set base_path"|tr -s " " " "|cut -d " " -f3`
+[ -d $base_path/mirror/ ] || mkdir -p $base_path/mirror/
+chown apt-mirror:apt-mirror $base_path/mirror/
+
+
+# Crear los directorios correspondientes a los mirrors.
+for i in $REPOS; do 
+  [ -d $base_path/mirror/$i ] || mkdir $base_path/mirror/$i 
+  chown apt-mirror:apt-mirror $base_path/mirror/$i
+  ln -s $base_path/mirror/$i /var/www
+  [ -d /var/www/html/ ] && ln -s $base_path/mirror/$i /var/www/html/
+done
+
diff --git a/debian/all/linex-mirror/debian/postrm b/debian/all/linex-mirror/debian/postrm
new file mode 100755
index 0000000..9f940ed
--- /dev/null
+++ b/debian/all/linex-mirror/debian/postrm
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+set -e
+
+PKG="linex-mirror"
+SHAREDIR="/usr/share/linex-mirror"
+
+remove_divert() {
+    diverter=$(dpkg-divert --listpackage $1)
+    if [ "$diverter" = "linex-mirror" ]; then
+        dpkg-divert --package linex-mirror --rename --remove $1
+    fi
+}
+
+
+if [ "$1" = remove ]; then
+
+	remove_divert /etc/apt/mirror.list
+	remove_divert /etc/cron.d/apt-mirror
+fi
+
+
+exit 0
diff --git a/debian/all/linex-mirror/debian/preinst b/debian/all/linex-mirror/debian/preinst
new file mode 100755
index 0000000..e3219ca
--- /dev/null
+++ b/debian/all/linex-mirror/debian/preinst
@@ -0,0 +1,17 @@
+#!/bin/bash
+set -e
+
+PKG="linex-mirror"
+SHAREDIR="/usr/share/linex-mirror"
+
+divert() {
+    diverted_file=$1
+
+    dpkg-divert --package "$PKG" --add --rename \
+	--divert "${diverted_file}-pre-$PKG" $diverted_file
+}
+
+divert /etc/apt/mirror.list
+divert /etc/cron.d/apt-mirror
+
+exit 0
diff --git a/debian/all/linex-mirror/debian/rules b/debian/all/linex-mirror/debian/rules
new file mode 100755
index 0000000..b760bee
--- /dev/null
+++ b/debian/all/linex-mirror/debian/rules
@@ -0,0 +1,13 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+	dh $@ 
diff --git a/debian/all/linex-mirror/debian/source/format b/debian/all/linex-mirror/debian/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/debian/all/linex-mirror/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/debian/all/linex-mirror/usr/share/linex-mirror/apt-mirror b/debian/all/linex-mirror/usr/share/linex-mirror/apt-mirror
new file mode 100644
index 0000000..fafb58f
--- /dev/null
+++ b/debian/all/linex-mirror/usr/share/linex-mirror/apt-mirror
@@ -0,0 +1,4 @@
+#
+# Regular cron jobs for the apt-mirror package
+#
+0 4	* * *	apt-mirror	/usr/bin/apt-mirror > /var/spool/apt-mirror/var/cron.log
diff --git a/debian/all/linex-mirror/usr/share/linex-mirror/mirror.list b/debian/all/linex-mirror/usr/share/linex-mirror/mirror.list
new file mode 100644
index 0000000..636a262
--- /dev/null
+++ b/debian/all/linex-mirror/usr/share/linex-mirror/mirror.list
@@ -0,0 +1,49 @@
+############# config ##################
+#
+#set base_path    /var/spool/apt-mirror
+set base_path    /var/apt-mirror
+#
+# set mirror_path  $base_path/mirror
+# set skel_path    $base_path/skel
+# set var_path     $base_path/var
+# set cleanscript $var_path/clean.sh
+# set defaultarch  <running host architecture>
+# set postmirror_script $var_path/postmirror.sh
+# set run_postmirror 0
+set nthreads     20
+set _tilde 0
+#set limit_rate 1000k
+#
+############# end config ##############
+
+
+#########   Inicio ubuntu 18.04   #########
+
+deb-amd64 http://es.archive.ubuntu.com/ubuntu/ bionic main restricted
+
+deb-amd64 http://es.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
+deb-amd64 http://es.archive.ubuntu.com/ubuntu/ bionic universe
+deb-amd64 http://es.archive.ubuntu.com/ubuntu/ bionic-updates universe
+deb-amd64 http://es.archive.ubuntu.com/ubuntu/ bionic multiverse
+
+deb-amd64 http://es.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
+
+deb-amd64 http://es.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
+
+deb-amd64 http://security.ubuntu.com/ubuntu bionic-security main restricted
+deb-amd64 http://security.ubuntu.com/ubuntu bionic-security universe
+deb-amd64 http://security.ubuntu.com/ubuntu bionic-security multiverse
+
+#########   FIN ubuntu 18.04   #########
+
+
+
+### Limpieza
+
+## Comento la limpieza para que no genere /var/apt-mirror/var/clean.sh que se utiliza para borrado de paquetes obseletos y directorios.
+## Lo hacemos para no perder el repo 14.04(congelado) comentado. 
+
+#clean http://es.archive.ubuntu.com/ubuntu/
+#clean http://security.ubuntu.com/ubuntu/
+#clean http://extras.ubuntu.com/ubuntu/
+
